[PLUG] Correct use of 'tee'

Jon LeVitre jonlevitre at yahoo.com
Mon Jan 16 20:06:45 UTC 2006


Rich Shepard said:
> ... Regardless, it does not answer my initial question:
> why 'tee' didn't work in my various trial-and-error
> permutations of the command line, and where there's
> better documentation for the tool than the man page.
>

I don't think that tee is the problem.  More likely it's the way in
which the shell redirects the streams.

For example, I know that `command 2>&1 1>/tmp/outfile` sends stderr to
the terminal and stdout to the file (instead of com

perl -e 'print STDERR "Error Message!\n"; print "Normal Message on
STDOUT\n";' 2>&1 1>/tmp/outfile

This may sound like a horrible kludge, but if all else fails try this:

  if [ 1 ]
  then 
    command 2>&1
  fi  | tee $outfile

Jon

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the PLUG mailing list