Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store output of system call to a variable

Status
Not open for further replies.

depsibob

Programmer
Apr 22, 2001
1
SE
Hi,

Writing a C program in unix, and
I want to do this system call "system (uptime)" and
store the output in a variable in C.
Is it possible ?
Or do I have to do something like this:
"system(uptime > /tmp/file1)" and then read the
file "file1" fom my C program.


//DepsiBob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top