Xref: utzoo comp.unix.internals:774 comp.unix.programmer:308 Path: utzoo!attcan!uunet!cs.utexas.edu!yale!mintaka!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.internals,comp.unix.programmer Subject: Re: System() function Message-ID: <1990Oct22.215234.21682@athena.mit.edu> Date: 22 Oct 90 21:52:34 GMT References: <24826@adm.BRL.MIL> Sender: daemon@athena.mit.edu (Mr Background) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Followup-To: comp.unix.programmer Organization: Massachusetts Institute of Technology Lines: 19 I fail to see how this has anything to do with Unix internals. It is clearly a question about programming under Unix, which means that it clearly belongs in comp.unix.programmer. I've cross-posted to comp.unix.programmer and directed followups there. In article <24826@adm.BRL.MIL>, vilva@csvax.csc.lsu.edu (Vilva Natarajan) writes: |> I am trying to do system("man cat | wc -c") in my program, and i need |> to store the value returned by "wc" in a variable declared in my program. Use popen("man cat | wc -c", "r"), which will return a FILE *, and you can read the output of wc from the FILE *. See popen(3). -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710