Posted by Chris Stillwell on April 19, 2001 at 12:01:05:
In Reply to: Output Redirection posted by Juan Romero Jr. on April 19, 2001 at 11:54:00:
: I know that the OS handles redirection into the output file and when we cout, that is supposed to get loged. Ive written the code to take arguments from the command line, so I can take the script filename, but when I cout anything, there isnt any redirection. Does anyone know how to do this?
Write (or modify) your program so that it takes only one argument from the command line and you'll be fine.
If you want to know why you'll be fine, look really closely at the specs where it says "Typically, the program will be invoked, using output redirection ..."
See the little '>' between the script argument and the log argument? That'll automatically take anything that gets sent to standard out and put it into the file specified by the log argument.
Post a Followup