On Wed, May 10, 2006 at 01:17:21PM -0500, Mark Rolen wrote:
> Luke Bakken wrote:
> >> cmd1 2>&1 >$WHERE
> >
> > This doesn't do what you think it does, which I'm assuming is redirect
> > stderr and stdout to $WHERE.
>
> What does it do? I was of the belief that it is indeed doing the above,
Parse from left to right:
- redirect stderr to the place stdout is currently going to.
- redirect stdout (and not stderr) to $WHERE
What you would want is
cmd1 >$WHERE 2>&1
again Parse from left to right:
- redirect stdout (and not stderr but now that is obvious) to $WHERE
- redirect stderr to the place stdout is currently going to. (also $WHERE
by now)
should bash behave differently, thats another reason to shun bash
> and the log/scratch files I redirect to have always seemed to back that
> up, showing both stdout- and stderr-looking output. I'd really like to
> know, and if there's something wrong with doing "2>&1 >" then what is
> the correct method?
Janjaap van Velthooven
-- ________________________________________
/ __/ /_ / ______/ /_ __/ __/ /___ /
/ /_ __/___/_/_ /___ / / __/ /___ / / [EMAIL PROTECTED]
/___/_/_________/_____/_/_/_/_______/_/_/