#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    lincoln
    Posts
    7
    Rep Power
    0

    use /usr/bin/uname in C program


    Hi All,
    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,
    Mani.
  2. #2
  3. *bounce*
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Delft, The Netherlands
    Posts
    514
    Rep Power
    42
    Try using popen() instead.
    "A poor programmer is he who blames his tools."
    http://analyser.oli.tudelft.nl/

IMN logo majestic logo threadwatch logo seochat tools logo