Stewart Stremler wrote:
> begin  quoting John H. Robinson, IV as of Thu, Jul 19, 2007 at 12:16:31PM 
> -0700:
> [snip]
> > 7) grep foo bar | while read line; do ((count++)); done
> >    Under bash, the value of count will not have changed as the pipelines
> >    are under subshells. zsh does not do this.
> > 
> >    for i in 1 2 3; do echo foo; done > bar
> >    unset count
> > 
> >    $ grep foo bar | while read line; do ((count++)); done
> >    $ echo :$count:
> >    ::
> > 
> >    % grep foo bar | while read line; do ((count++)); done
> >    % echo :$count:
> >    :3:
> 
> Not sure I'd consider this a feature. Subshells are *supposed* to be
> divorced from their parent environment.

() is a subshell. (()) is arithmetic. while do done? I've never thought
of that as a subshll, and I am unsure what POSIX has to say about it.


> > chsh -s "`command which zsh`"
> 
> It seems zsh does not set the SHELL environment variable.

No, login(1) does.

% man login|grep -C 1 SHELL
       exists (other environment variables are preserved if the -p  option  is
       used).  Then the HOME, PATH, SHELL, TERM, MAIL, and LOGNAME environment
       variables are set.  PATH defaults to  /usr/local/bin:/bin:/usr/bin  for

[EMAIL PROTECTED]:~]% echo $SHELL
/bin/zsh
[EMAIL PROTECTED]:~]% bash
[EMAIL PROTECTED] ~]$ echo $SHELL
/bin/zsh

-john


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to