From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11102 invoked from network); 30 Sep 1997 06:22:49 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 30 Sep 1997 06:22:49 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id CAA05012; Tue, 30 Sep 1997 02:02:48 -0400 (EDT) Resent-Date: Tue, 30 Sep 1997 02:01:23 -0400 (EDT) From: "Bart Schaefer" Message-Id: <970929230139.ZM13906@candle.brasslantern.com> Date: Mon, 29 Sep 1997 23:01:38 -0700 In-Reply-To: <19970930000422.03879@supernova.math.lsa.umich.edu> Comments: In reply to Jahwan Kim "Redirection in the middle of a script?" (Sep 30, 12:04am) References: <19970930000422.03879@supernova.math.lsa.umich.edu> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Jahwan Kim , zsh-users@math.gatech.edu Subject: Re: Redirection in the middle of a script? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"wSJb.0.7D1.oM9Cq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1049 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sep 30, 12:04am, Jahwan Kim wrote: } Subject: Redirection in the middle of a script? } } I have this long-standing question, which I can't find an answer to, } perhaps because it's impossible. Is it possible to redirect } STDOUT/STDIN/STDERR/just about any file descriptor *in the middle of* a } script, not at the beginning? That is, You can do this in any Bourne-shell-like shell, even very old ones, with exec foo.out # redirects stdout exec 2>foo.err # redirects stderr This is all documented in the "Redirection" section of the zsh manual. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com