zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: <> redirection operator
Date: Mon, 04 Jun 2001 00:14:00 +0100	[thread overview]
Message-ID: <20010603231405.92A4614285@pwstephenson.fsnet.co.uk> (raw)
In-Reply-To: "Clint Adams"'s message of "Sun, 03 Jun 2001 17:00:08 EDT." <20010603170008.A32165@dman.com>

(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@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


  reply	other threads:[~2001-06-03 22:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-03 20:10 Clint Adams
2001-06-03 20:49 ` Bart Schaefer
2001-06-03 21:00   ` Clint Adams
2001-06-03 23:14     ` Peter Stephenson [this message]
2001-06-03 23:06       ` Bart Schaefer
     [not found] <201112221539.pBMFdlaj011933@penguin.research.att.com>
2011-12-22 21:03 ` '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)] Eric Blake
2011-12-22 22:09   ` Bruce Korb
2011-12-22 23:34     ` '>;' redirection operator Thorsten Glaser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010603231405.92A4614285@pwstephenson.fsnet.co.uk \
    --to=pws@pwstephenson.fsnet.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).