Hi. I am using a Bourne script like this:
myscript.sh >& myoutput.out
Instead of doing this, is there a command I can put inside my script to
cause it to redirect output in this way?
[...]Quote:> Hi. I am using a Bourne script like this:
> myscript.sh >& myoutput.out
> Instead of doing this, is there a command I can put inside my script to
> cause it to redirect output in this way?
#! /bin/sh -
exec > myoutput.out 2>&1
# the remaining of your script goes here
#! /bin/sh -
# your script goes here
Note that if myoutput.out can't be open for writing, the scriptQuote:} > myoutput.out 2>&1
Hi all, hope this is an OK spot to post this question (redirections welcome).
I am using someone's Perl script to do some number crunching. Rather than
spend all day staring at the output flying by hoping to catch any errors
I'd like to let it run overnight if I could put all that stuff written to
screen in a file instead, which would be much easier to inspect to see
where things bomb if they do (and they probably will at first). The
problem is the script asks a couple questions first, to which you have to
enter parameters (yes, and 84).
Is there a simple shell command or trick that will let me run the script
and redirect everything written by the print statements to a file, after
I've answered the two questions?
I'm told I'm using the TCSH or tcshell on SGI machines. Normally I type
the name of the script:
answer the two questions and then stuff whizzes by in the window for hours.
Thanks most sincerely for any help,