From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16629 invoked from network); 7 Aug 1998 16:16:27 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 7 Aug 1998 16:16:27 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id LAA12304; Fri, 7 Aug 1998 11:58:41 -0400 (EDT) Resent-Date: Fri, 7 Aug 1998 11:58:30 -0400 (EDT) Date: Fri, 7 Aug 1998 17:00:40 +0100 (BST) From: "Owen M. Astley" X-Sender: oma1000@alpha2.poco.phy.cam.ac.uk To: Jan Kroken cc: zsh-users@math.gatech.edu Subject: Re: Redirection (<>) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Owen Astley Resent-Message-ID: <"7JJNV1.0.b_2.bGoor"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1708 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > >From zsh.info: > `<>WORD' > Open file WORD for reading and writing as standard input. If the ^^^^^^^^^^^^^^ > file does not exist then it is created. > > and here's what happens when I try to use it. > > ~/tmp% cat > f > a b d f > c d c > c c d > e c d > ~/tmp% sed "s/c/f/g" <> f > a b d f > f d f > f f d > e f d > ~/tmp% cat f > a b d f > c d c > c c d > e c d > ~/tmp% > > And my question is; Why does the output from sed go to stdout? > > What does <> really mean? It means that the file is opened rw as stdin (instead of read-only, as normal). sed sends its output to stdout. If you had a program that tried to write to stdin it would normally fail (presumably), but wouldn't if you used <>. (Note: I haven't tried this). Owen