[Sunhelp] Redirecting STDERR

Rui Monteiro rmonteiro at whatevernet.pt
Mon Sep 4 13:55:22 CDT 2000


--------------888B69111CEBBD4C989148EF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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 ?

Regards.

Jan Jansta wrote:

> Try to use sh, ksh, bash. Then you can redirect STDERR to file
> this way
> # command 2>filename
>
> or you can redirect STDERR to STDOUT as well
> # command 2>&1
>
> # command >stdout_and_stderr.out 2>&1
>
> You cannot use this feature in csh/tcsh.
>
> good luck
>
> Jan
>
> > Date: Mon, 04 Sep 2000 11:33:09 +0100
> > From: Rui Monteiro <rmonteiro at whatevernet.pt>
> > To: sunhelp at sunhelp.org
> > boundary="------------09E7FF26AF3F685533BDCBDF"
> > Subject: [Sunhelp] Redirecting STDERR
> > Reply-To: sunhelp at sunhelp.org
> >
> >
> > --------------09E7FF26AF3F685533BDCBDF
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > Hello,
> >
> > anyone knows how to redirect the STDERR of the current shell
> > session so
> > that any commands given have their STDERR also redirected ?
> >
> > Thanks in advance.
> >
> > Regards.
> >
> > --
> > Rui Monteiro                WhatEverNet Computing, SA
> > rmonteiro at whatevernet.com   Praca de Alvalade, 6 - Piso 6
> > Phone: +351 21 7994200      1700 036 Lisboa - Portugal
> > Fax:   +351 21 7994242      http://www.whatevernet.com
> >
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp

--
Rui Monteiro                WhatEverNet Computing, SA
rmonteiro at whatevernet.com   Praca de Alvalade, 6 - Piso 6
Phone: +351 21 7994200      1700 036 Lisboa - Portugal
Fax:   +351 21 7994242      http://www.whatevernet.com



--------------888B69111CEBBD4C989148EF
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Thanks for your reply Jan, but that's not what i want.
<p>I don't want to redirect STDERR for each command i write.
<br>What i want is to redirect STDERR once and then have all the commands
writen after that with their STDERR also redirected.
<p>Ex:
<br>$ STDERR redirected to /tmp/stderr.txt
<br>$ command1
<br>$ command2
<br>$ command3
<p>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.
<p>Do you know how to do this ?
<p>Regards.
<p>Jan Jansta wrote:
<blockquote TYPE=CITE>Try to use sh, ksh, bash. Then you can redirect STDERR
to file
<br>this way
<br># command 2>filename
<p>or you can redirect STDERR to STDOUT as well
<br># command 2>&1
<p># command >stdout_and_stderr.out 2>&1
<p>You cannot use this feature in csh/tcsh.
<p>good luck
<p>Jan
<p>> Date: Mon, 04 Sep 2000 11:33:09 +0100
<br>> From: Rui Monteiro <rmonteiro at whatevernet.pt>
<br>> To: sunhelp at sunhelp.org
<br>> boundary="------------09E7FF26AF3F685533BDCBDF"
<br>> Subject: [Sunhelp] Redirecting STDERR
<br>> Reply-To: sunhelp at sunhelp.org
<br>>
<br>>
<br>> --------------09E7FF26AF3F685533BDCBDF
<br>> Content-Type: text/plain; charset=us-ascii
<br>> Content-Transfer-Encoding: 7bit
<br>>
<br>> Hello,
<br>>
<br>> anyone knows how to redirect the STDERR of the current shell
<br>> session so
<br>> that any commands given have their STDERR also redirected ?
<br>>
<br>> Thanks in advance.
<br>>
<br>> Regards.
<br>>
<br>> --
<br>> Rui Monteiro               
WhatEverNet Computing, SA
<br>> rmonteiro at whatevernet.com   Praca de Alvalade, 6 - Piso
6
<br>> Phone: +351 21 7994200      1700 036 Lisboa
- Portugal
<br>> Fax:   +351 21 7994242      <a href="http://www.whatevernet.com">http://www.whatevernet.com</a>
<br>>
<p>__________________________________________________
<br>Do You Yahoo!?
<br>Yahoo! Mail - Free email you can access from anywhere!
<br><a href="http://mail.yahoo.com/">http://mail.yahoo.com/</a>
<br>_______________________________________________
<br>SunHELP maillist  -  SunHELP at sunhelp.org
<br><a href="http://www.sunhelp.org/mailman/listinfo/sunhelp">http://www.sunhelp.org/mailman/listinfo/sunhelp</a></blockquote>

<pre>-- 
Rui Monteiro                WhatEverNet Computing, SA 
rmonteiro at whatevernet.com   Praca de Alvalade, 6 - Piso 6
Phone: +351 21 7994200      1700 036 Lisboa - Portugal
Fax:   +351 21 7994242      <A HREF="http://www.whatevernet.com">http://www.whatevernet.com</A></pre>
 </html>

--------------888B69111CEBBD4C989148EF--






More information about the SunHELP mailing list