[CLUE-Tech] bash: overwrite and redirect
Michael J. Hammel
mjhammel at graphics-muse.org
Tue Feb 18 09:17:41 MST 2003
On Tue, 2003-02-18 at 10:57, marcus hall wrote:
> Careful about the order.. There is a subtle ordering to when each
> argument is processed. The above will first dup stdout to stderr,
> *then* point stdout to result_file. So, stderr will be going to
> the old destination of stdout and only stdout will be going to the
> file. You really need to say:
>
> some command > result_file 2>&1
Argggh. I'm starting to hate bash. I may switch back to ksh. At least
on FreeBSD the order is correct - I use it all the time there, like so:
make blah 2>&1 | tee make.out
This has the desired effect of redirecting stderr to stdout and then
piping stdout to "tee" under FreeBSD using bash. If this does not work
under Linux, then consistancy does not seem to be the order of the day
for that shell.
--
Michael J. Hammel <mjhammel at graphics-muse.org>
Graphics Muse
More information about the clue-tech
mailing list