From owner-freebsd-questions Tue May 27 20:07:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA18963 for questions-outgoing; Tue, 27 May 1997 20:07:15 -0700 (PDT) Received: from iceberg.anchorage.net. (root@iceberg.anchorage.net [207.14.72.150]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id UAA18950 for ; Tue, 27 May 1997 20:07:09 -0700 (PDT) Received: from aak.anchorage.net (ai-130 [207.14.72.130]) by iceberg.anchorage.net. (8.6.11/8.7.3) with SMTP id SAA13373; Tue, 27 May 1997 18:04:05 -0800 Date: Tue, 27 May 1997 18:46:10 -0800 (AKDT) From: Steve Howe X-Sender: abc@aak.anchorage.net To: Zahemszky Gabor cc: freebsd-questions Subject: Re: What command line to redirect 'make world' warnings ? In-Reply-To: <199705270909.LAA00404@CoDe.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk ouch! you are hurting my brains! :) i notice the sh man page says nothing about this stuff ... and i also notice that the shell newsgroup is appears "dead". > because redirection occures (most of the times) from left to right. ok. > > make world 2>&1 > /proxy/world3 stdout to tty stderr to tty redirection 2>&1 stderr to stdout (tty) redirection > file stdout to file got it! i think this is an easy mistake to make, since one would assume if a stderr is duplicated on stdout, then any redirection of stdout would also apply to stderr. > make world > /proxy/world3 2>&1 stdout to tty stderr to tty redirection > file stdout to file redirection 2>&1 stderr to stdout (file) got it. i notice "make world > 2>&1 /proxy/world3" is an error, but "make world 2>&1 > /proxy/world3" is not! (sh) i can't make sense out of this. it seems to me they shoud either BOTH be errors, or BOTH be functional. ??? > RTMF! from bash manual: Read The Manual xxxxhead! ??? hehe! > ls > dirlist 2>&1 stdout to tty stderr to tty redirection > file stdout to file redirection 2>&1 stderr to stdout (file) > ls 2>&1 > dirlist stdout to tty stderr to tty redirection 2>&1 stderr to stdout redirection > file stdout to file > &>word > and > >&word > > Of the two forms, the first is preferred. > This is semantically equivalent to > > >word 2>&1 > > This type of redirection is working only in bash ... so with bash one could say: make world 2&>1 /proxy/world3 and get the desired effect, correct? (i don't have bash ...) > ( make world 2>&1 >> /proxy/world3 ) > /proxy/world3 in a subshell: stdout to tty stderr to tty redirection 2>&1 stderr to stdout stdout >> file end subshell. -------------- redirection > file stdout (subshell stderr) > file got it! > { make world 2>&1 >> /proxy/world3 ; } > /proxy/world3 same thing with grouping instead of subshell spawning. > and you have to use append ( >> ) inside. Well, why? It's your exercise. hmmm. in sh, ">" inside works as well ... ??? > Bye, Gabor ------------------------------------------------------------------------- Sleep: a sign a caffeine deprivation ... http://www.anchorage.net/~un_x -------------------------------------------------------------------------