From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16398 invoked from network); 10 Jun 1999 03:16:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Jun 1999 03:16:36 -0000 Received: (qmail 6844 invoked by alias); 10 Jun 1999 03:16:05 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2378 Received: (qmail 6837 invoked from network); 10 Jun 1999 03:16:03 -0000 From: "Bart Schaefer" Message-Id: <990610031542.ZM206@candle.brasslantern.com> Date: Thu, 10 Jun 1999 03:15:42 +0000 In-Reply-To: <19990609172916.A17470@astaroth.nit.gwu.edu> Comments: In reply to Sweth Chandramouli "Re: tee-like file redirection in shell?" (Jun 9, 5:29pm) References: <19990609094032.A15964@astaroth.nit.gwu.edu> <19990609172916.A17470@astaroth.nit.gwu.edu> X-Mailer: Z-Mail (5.0.0 30July97) To: ZSH Users Subject: Re: tee-like file redirection in shell? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 9, 5:29pm, Sweth Chandramouli wrote: } Subject: Re: tee-like file redirection in shell? } } On Wed, Jun 09, 1999 at 08:16:39PM +0100, Bruce Stephens wrote: } > Sweth Chandramouli writes: } > } > You need the multios option set, and I don't recall whether it's the } > default or not (it probably should be). It's not set by default because of the way it interacts with globbing. If you do something like echo "Create this file" > * then zsh will write to every file in the current directory (unless the noclobber option is set). } > Is there any nicer way to say "save to a file and show the results" } > than using the ugly "| cat"? } } i don't know that it's particularly nicer, but something like } % ps > some_file > /dev/stdout In addition to the trick that Geoff mentioned using >&1, zsh interprets the path /dev/fd/ magically. So on any operating system, even those that do not support the /dev/fd/ directory, you can use /dev/fd/0 (standard input) /dev/fd/1 (standard output) /dev/fd/2 (standard error) (etc.) So >/dev/fd/1 is the same as >&1, and so forth, except that with the /dev/fd/ files the file descriptor must already exist -- it won't be duplicated from another file descriptor. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com