UNIX commands in C

Glenn Crocker glenn at curie.ces.cwru.edu
Mon Apr 29 10:43:36 AEST 1991


jtanner at jack.sns.com (Jason Tanner) writes:
   ...
   I know how to use all the regular C commands but I would like
   to know how to use UNIX commands from within a C program. For example
   to have the option to show who is online from within a program. I dont
   want this done with a shell escape I want it to be an potion like from a
   menu/list.

Check out the popen() function.  It allows you to open a pipe to a
specified program and then read from it or write to it just like a
normal file descriptor (FILE *).  If you'd like an example program
that uses it, mail me.

--
Glenn Crocker                   |  Your milage may vary.
glenn at ces.cwru.edu              |  Light bar not for occupant protection.
CWRU, Cleveland, OH             |  Don't drive on frozen lakes.
W (216)368-6133 H (216)754-1314 |  Do not taunt Happy Fun Ball.



More information about the Comp.unix.questions mailing list