Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Nov 1998 23:57:59 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        Dan Nelson <dnelson@emsphone.com>
Cc:        Brian Somers <brian@Awfulhak.org>, "John W. DeBoskey" <jwd@unx.sas.com>, Brian Feldman <green@zone.syracuse.net>, freebsd-current@FreeBSD.ORG
Subject:   Re: Changing sh for compatibility sake 
Message-ID:  <199811022357.XAA03594@woof.lan.awfulhak.org>
In-Reply-To: Your message of "Sun, 01 Nov 1998 21:05:12 CST." <19981101210512.A21213@emsphone.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811022357.XAA03594>