System() function

Brian Chapman chapman at sco.COM
Fri Oct 26 14:34:52 AEST 1990


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.
>I dont want to redirect it to a file and then read from the file.
>Please advice.


Try looking in to popen() rater than system().  popen()
is the same thing except you get pipes to and from the
command.

-- 
Brian Chapman		uunet!sco!chapman
Pay no attention to the man behind the curtain!



More information about the Comp.unix.internals mailing list