Xref: utzoo comp.unix.questions:30838 comp.lang.c:38814 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!dimacs.rutgers.edu!rutgers!rochester!kodak!ispd-newsserver!garden.ssd.kodak.com!weimer From: weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: UNIX commands in C Message-ID: <1991Apr29.142808.3201@ssd.kodak.com> Date: 29 Apr 91 14:28:08 GMT References: <1991Apr28.153127.24926@jack.sns.com> Sender: news@ssd.kodak.com Reply-To: weimer@ssd.kodak.com Organization: Eastman Kodak Co.; Rochester, NY Lines: 23 In article <1991Apr28.153127.24926@jack.sns.com> you write: |> |> I have been programming C for a while on IBM compats. using Turbo-C |> from Borland. Now I would like to move up to programing C in the UNIX |> enviroment. 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. Since I don't see any other posts, I'll post and maybe save you some mail. The easiest thing to do is use system(3). Since you're new to UNIX, this means the system command in section 3 of the man pages. If you want to see the man page entry for this, type 'man 3 system' (without the quotes). You might also want to look at fork(2V) (use 'man 2 fork', not 'man 2V fork') and execl(3V). weimer@ssd.kodak.com ( Gary Weimer )