August 15th, 2003, 06:59 PM
use /usr/bin/uname in C program
I am trying to do the following:
system("/usr/bin/uname -n|cut -c1-") which returns me string "ibm34" to the stdout. I want to capture this value to a string variable but unsuccessful. I would appreciate if somebody can let me know how to use uname command in C program and capture the value.
Thanks in Advance,
August 15th, 2003, 08:14 PM
Try using popen() instead.
"A poor programmer is he who blames his tools."