[Sunhelp] Redirecting STDERR

Doug McLaren dougmc at frenzy.com
Mon Sep 4 14:56:44 CDT 2000


On Mon, Sep 04, 2000 at 07:55:22PM +0100, Rui Monteiro wrote:

| Thanks for your reply Jan, but that's not what i want.
| 
| I don't want to redirect STDERR for each command i write.
| What i want is to redirect STDERR once and then have all the commands
| writen after that with their STDERR also redirected.
| 
| Ex:
| $ STDERR redirected to /tmp/stderr.txt
| $ command1
| $ command2
| $ command3
| 
| command1, command2 and command3 should have their STDERR redirected to
| /tmp/stderr.txt, without the need to do 2>/tmp/stderr.txt for each one.
| 
| Do you know how to do this ?

exec 2> /tmp/stderr.txt
command1
command2
command3

sh/bash/ksh/zsh only - not tcsh/csh.

--
Doug McLaren, dougmc at frenzy.com
"Verbosity leads to unclear, inarticulate things."  --Quayle





More information about the SunHELP mailing list