Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Redirection in the middle of a script?
- X-seq: zsh-users 1049
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Jahwan Kim <jahwan@xxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Redirection in the middle of a script?
- Date: Mon, 29 Sep 1997 23:01:38 -0700
- In-reply-to: <19970930000422.03879@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <19970930000422.03879@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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.in # redirects stdin
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author