I am supposed to put the following command in the system function argument in a C program.
$ timed-run 20 prog1 1 1>/dev/null 2>abc.dat
timed-run is supposed to execute prog1 up to 20 seconds and then terminate it. I want the output of prog1 to be redirected to abc.dat. Is there any solution for this?
Thanks
timed-run 20 prog1 2>/dev/null 1>abc.dat. I didn't get your question - what isn't working? Do you need to write the program 'timed-run'?