Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: <> redirection operator
- X-seq: zsh-workers 14699
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: <> redirection operator
- Date: Mon, 04 Jun 2001 00:14:00 +0100
- In-reply-to: "Clint Adams"'s message of "Sun, 03 Jun 2001 17:00:08 EDT." <20010603170008.A32165@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
(Sigh. After half a dozen years of the mailing list sending replies to the
original sender, I'm still forgetting to change the address.)
Clint Adams wrote:
> > All this means is that fd 0 is O_RDWR rather than O_RDONLY. It still
> > opens exactly one descriptor.
>
> Ah. What is the point of that?
To put it another way,
% echo test >/tmp/redirtest
% sed 's/e/Z/g' <>/tmp/redirtest 1>&0
% cat /tmp/redirtest
tZst
(This happens to work in place even on a mult-line file, but I think you
have to be pretty sure what you're doing to use it like that. Finally I've
got an example of this for the user guide, anyway.)
It's just consistently applying the rule that one redirection redirects
exactly one file descriptor, and to do the other you need to do it
explcitly as above.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk
Messages sorted by:
Reverse Date,
Date,
Thread,
Author