Re: tee -a to to files



On Thu, 08 Dec 2005 13:07:25 +0200, Etienne Marais wrote:
[...]
> 2) two files, one containg stdout and the other stderr ?
[...]
> 2) command 2> /path/to/errfile | tee /path/to/stdoutfile
>
> But 2 will not display errors on the output anymore,
> perhaps that's part of the reason you asked ?
>
> How does one do ' 2| ' analogous to ' 2> ' ?

2> is a redirection operator, "|" is a more complicate thing
that starts two commands simultanously and does some implicit
redirections. You can change those redirections with redirection
operators:

{ cmd 2>&1 >&3 3>&- | tee err >&2 3>&-; } 3>&-

{ { cmd | tee out; } 2>&1 >&3 3>&- | tee err >&2 3>&-; } 3>&1

--
Stephane
.



Relevant Pages

  • Re: KeyBoard interrupt and Redirection operator
    ... I have a program which i use like this scraps.py arg1 arg2> filename. ... using the redirection operator to direct the output to the filename .The ... and most people will leave it pointing to the console. ...
    (comp.lang.python)
  • Re: how to delete the first two characters of each row?
    ... If the redirection operator is>, and the noclobber ... option to the set builtin has been enabled, ...
    (comp.lang.ruby)
  • Re: redirection operator
    ... can anyone tell me why do we use redirection operator in linux ... What is it you refer to as "redirection operator"? ... so the answer "in reference to windows" is the same. ...
    (comp.os.linux.development.apps)
  • redirection (was: find)
    ... > Janis Papanagnou writes: ... >> The position of the redirection operator is important... ... There are a few exceptions to this general rule: ...
    (comp.unix.shell)