Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 1997 13:26:30 -0800 (AKDT)
From:      Steve Howe <un_x@anchorage.net>
To:        Zahemszky Gabor <zgabor@CoDe.hu>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: What command line to redirect 'make world' warnings ?
Message-ID:  <Pine.BSF.3.95q.970530132117.389B-100000@aak.anchorage.net>
In-Reply-To: <199705281450.QAA00425@CoDe.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 May 1997, Zahemszky Gabor wrote:

> > ( make world 2>&1 >> /proxy/world3 ) > /proxy/world3

> > > and you have to use append ( >> ) inside.  Well, why?  It's your exercise.

> > hmmm.  in sh, ">" inside works as well ... ???

> Really?  If it is, I think, it's a bug in shell, because first, we make the
> redirection in the parent shell, after the subshell.  But in the subshell,
> with ">", we reopen it with truncation, but with ">>", with append only.
> Well, I've tried it with 2.1.5's sh, with pdksh 5.2.12 and with bash 1.14.5,
> and worked as I wrote.  I think, in your example, you hadn't got an error
> message.  Try this one:

> $ echo lo > file
> $ ( cat nosuchfile lo 2>&1 > f ) > f ; cat f
> lo

> cat: nosuchfile: No such file or directory
> lo
> $

> Well, I think maybe it's some undocumented behaviour of not a bug/not a
> feature of the buffering of shell.???

$ ( cat nosuchfile lo 2>&1 > f ) > f ; cat f
cat: nosuchfile: No such file or directory
cat: lo: No such file or directory

hmmm!  i'm using sh - 2.2.1 ...

something is wrong somewhere! :)
-------------------------------------------------------------------------
 Sleep: a sign a caffeine deprivation ... http://www.anchorage.net/~un_x
-------------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970530132117.389B-100000>