help with redirecting std output & errors
hi all,
i am currently stuck on a project and would appriciate any help.
i have to write a spawn program which accepts info from the command line and then sorts out the arguments.
if -o is an argument then the following arg is the filename where the o/p is sent.
if -e is present the the next arg is the file name where the errors are sent.
e.g.
$ spawn [-o filename] [-e filename] command_sequence
or
$ ./spawn -o list.dat ls -l /home/jbloggs
[New list.dat file contains long listing of the jbloggs directory.]
any ideas?
thanks!