System() function

Jonathan I. Kamens jik at athena.mit.edu
Tue Oct 23 07:52:34 AEST 1990


  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 at adm.BRL.MIL>, vilva at 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 at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.programmer mailing list