Bastille

Geoff Shang gshang at uq.net.au
Sat Sep 28 22:33:20 EDT 2002


On Sat, 28 Sep 2002, Scott Howell wrote:

> can't captured the errors its generating in the scripts cause they just
> scroll off the screen. Is there a way to capture these? The error log it
> generates isn't giving me any useful data.

You can do this by redirecting standard error, either to standard out or to
a file.  Some examples:

<command> 2>&1
redirects standard error to standard output.  This means you can do
commands like:
<command> 2>&1 |more
or
<command> 2>&1 >filename.log

to capture everything.  This is mainly useful when you need to see errors
in context, such as with a compilation.

If you only want to log the errors, you can do:
<command> 2>filename.log

Using this logic, you can make a program only display the errors with no
regular output by doing
<command> >/dev/null

since you've only redirected standard output, standard error will still be
seen.

Hope this helps.

Geoff.






More information about the Speakup mailing list