From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25546 invoked from network); 3 Jun 2001 22:13:34 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jun 2001 22:13:34 -0000 Received: (qmail 12856 invoked by alias); 3 Jun 2001 22:13:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14699 Received: (qmail 12842 invoked from network); 3 Jun 2001 22:13:08 -0000 To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: <> redirection operator In-reply-to: "Clint Adams"'s message of "Sun, 03 Jun 2001 17:00:08 EDT." <20010603170008.A32165@dman.com> Date: Mon, 04 Jun 2001 00:14:00 +0100 From: Peter Stephenson Message-Id: <20010603231405.92A4614285@pwstephenson.fsnet.co.uk> (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 Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk