From owner-freebsd-current Mon Nov 2 17:37:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA14867 for freebsd-current-outgoing; Mon, 2 Nov 1998 17:37:38 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA14832 for ; Mon, 2 Nov 1998 17:37:25 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from woof.lan.awfulhak.org (root@woof.lan.Awfulhak.org [172.16.0.7]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id XAA05989; Mon, 2 Nov 1998 23:57:24 GMT (envelope-from brian@Awfulhak.org) Received: from woof.lan.awfulhak.org (brian@localhost [127.0.0.1]) by woof.lan.awfulhak.org (8.9.1/8.9.1) with ESMTP id XAA03594; Mon, 2 Nov 1998 23:57:59 GMT (envelope-from brian@woof.lan.awfulhak.org) Message-Id: <199811022357.XAA03594@woof.lan.awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Dan Nelson cc: Brian Somers , "John W. DeBoskey" , Brian Feldman , freebsd-current@FreeBSD.ORG Subject: Re: Changing sh for compatibility sake In-reply-to: Your message of "Sun, 01 Nov 1998 21:05:12 CST." <19981101210512.A21213@emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 02 Nov 1998 23:57:59 +0000 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > In the last episode (Nov 01), Brian Somers said: > > The *only* shell I've ever seen that does this is the original ksh. > > I think it's a *great* feature, but it's also non-standard. With it, > > you can also > > > > echo hello there | read a b > > > > and get $a and $b back. Certainly, any version of sh, ash, zsh, bash > > and pdksh that I've seen execute everything in the pipe in a subshell. > > ? I thought standard procedure was to execute the last command in a > pipe in the parent shell. Your command runs fine on zsh and bash (not > ash though). I haven't got an installed zsh handy, but: dev:~ $ bash dev:~ $ echo hello there | read a b dev:~ $ echo $a $b dev:~ $ echo $BASH_VERSION 2.01.0(1)-release dev:~ $ >From the man page: Each command in a pipeline is executed as a separate pro- cess (i.e., in a subshell). Zsh behaved the same with the latest release from about 3 months ago. > -Dan -- Brian , , Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message