[plug] saving screen output

Russell Steicke r.steicke at bom.gov.au
Tue Feb 22 21:09:44 WST 2005


On Tue, Feb 22, 2005 at 08:48:30PM +0800, Leon Brooks wrote:
...
> This captures stderr as well. You could do the same thing with:
> 
>     exim -d -bt xxxxan at westnet.com.au 2>&1 > eximcmd
> 
> This says "send stderr to the same place as stdout" then "jam stdout 
> into a file called eximcmd".

Yes, it does say that, but the effect isn't what is wanted here.  It
says "direct stderr to the same place as stdout, and then _after_
that, direct stdout to a file called eximcmd."  To get them both into
the one file, you have to do

  foo > eximcmd 2>&1

or

  foo 2>eximcmd 1>&2

eg:

  $ alias foo='( echo stdout; echo stderr 1>&2 )'
  $ foo
  stdout
  stderr
  $ foo 2>&1 >/dev/null
  stderr
  $ foo >/dev/null 2>&1
  $ foo 2>/dev/null 1>&2
  $ 



-- 
Russell Steicke

-- Fortune says:
Some people pray for more than they are willing to work for.



More information about the plug mailing list