Xref: utzoo comp.unix.questions:30839 comp.lang.c:38815 Newsgroups: comp.unix.questions,comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!ukma!usenet.ins.cwru.edu!usenet.INS.CWRU.Edu!glenn From: glenn@curie.ces.cwru.edu (Glenn Crocker) Subject: Re: UNIX commands in C In-Reply-To: jtanner@jack.sns.com's message of 28 Apr 91 15:31:27 GMT Message-ID: Sender: news@usenet.ins.cwru.edu Nntp-Posting-Host: curie.ces.cwru.edu Organization: Case Western Reserve University References: <1991Apr28.153127.24926@jack.sns.com> Date: 29 Apr 91 10:43:36 Lines: 20 jtanner@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@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.