- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: The usage of function system() in UNIX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 04:57 PM
тАО06-07-2007 04:57 PM
I dont kn ow this is is the right place to put this query. But, it will help me a lot if i can get the answer from any one of you.
Question is the system() builin function returns the integer value. But, i want to store the result of the command executed
ex- system("pwd"); in a string variable.
How can i achieve this?
thanks in advance
Vikram
Solved! Go to Solution.
- Tags:
- system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 05:46 PM
тАО06-07-2007 05:46 PM
Re: The usage of function system() in UNIX
program, or in a perl script, or where?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 06:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 10:16 PM
тАО06-07-2007 10:16 PM
Re: The usage of function system() in UNIX
Not any scripts.
thanks and regards
Vikram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 10:21 PM
тАО06-07-2007 10:21 PM
Re: The usage of function system() in UNIX
Then you need to look into popen(3). That provides you with:
popen() creates a pipe between the calling program and a command to be executed by the POSIX shell
Then you just do fgets on the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2007 02:37 AM
тАО06-08-2007 02:37 AM
Re: The usage of function system() in UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2007 03:21 AM
тАО06-08-2007 03:21 AM
Re: The usage of function system() in UNIX
http://www.opengroup.org/onlinepubs/009695399/functions/popen.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2007 12:02 AM
тАО06-11-2007 12:02 AM
Re: The usage of function system() in UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2007 12:37 AM
тАО06-11-2007 12:37 AM
Re: The usage of function system() in UNIX
thnaks and regards
Vikram