redirecting error-messages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

redirecting error-messages

Stef Pillaert BK-2
Hello,

I do a lot of my octave-calculations in the background, so I do things like:
'calculate.bat > calculate.comment &'
where calculate.bat calls a few octave-functions, and I look at the results
in calculate.comment afterwards. This all works fine, but sometimes I have
errors (because of some mistake I made in an .oct-file, or because of
memory-overloading, ...), and the error-messages don't show in the
calculate.comment-file (they are sent to the terminal)... Is there a way to
direct these messages to a file?
I realise this isn't a real 'octave'-question, but a 'Unix'-question (not
my strongest side...), but when I posted this question to some Unix-groups,
I didn't get an answer, so...)

Thanks,

Stef.


Reply | Threaded
Open this post in threaded view
|

Re: redirecting error-messages

Martin Holz-2
Stef Pillaert <[hidden email]> writes:
> I do a lot of my octave-calculations in the background, so I do things like:
> 'calculate.bat > calculate.comment &'
> where calculate.bat calls a few octave-functions, and I look at the results
> in calculate.comment afterwards. This all works fine, but sometimes I have
> errors (because of some mistake I made in an .oct-file, or because of
> memory-overloading, ...), and the error-messages don't show in the
> calculate.comment-file (they are sent to the terminal)... Is there a way to
> direct these messages to a file?

#!/bin/sh
# Redirect the stderr stream to stdout and send stdout to file.
octave < inputfile > outputfile 2>&1 &