Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Lonely spacecowboy




----- Original Message ----- From: "Frank Terbeck" <ft@xxxxxxxxxxxxxxxxxxx>
To: <zsh-users@xxxxxxxxxx>
Sent: Tuesday, March 27, 2007 4:32 PM
Subject: Re: Lonely spacecowboy


Brian K. White <brian@xxxxxxxxx>:
Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>:
>On Tue, Mar 27, 2007 at 03:01:42PM -0400, Brian K. White wrote:
[...]
>>The difference is "|read" creates a child process that read runs in, >>and
>>any env variables set in that child process are not visible from the
>>parent, and the while-do-done command (and all commands in that loop) >>ar
>>running in the parent.
>
>While this is true for bash and pdksh it's not true for zsh:
>
>~$ echo foo | read
>~$ echo $REPLY
>foo
[...]
It doesn't work in one enviroment I use zsh a lot in.

$P$Gecho this is a test |read aa bb cc
$P$Gecho $aa $bb $cc

$P$G

This is latest freestanding (static binary not needing cygwin dll) version
of zsh for windows that I have been able to locate, which is quite old,
$P$Gecho $VERSION
3.0.5.001
$P$G

Hm, I don't know about the specifics of the native windows port of
zsh. But AFAIK, zsh versions v3 and above do not set $VERSION but
$ZSH_VERSION. I tried the above on a linux v2.6 system:

[snip]
zsh% echo this is a test |read aa bb cc
zsh% echo $aa $bb $cc
this is a test
zsh% echo $ZSH_VERSION
3.0.4
zsh% echo $VERSION

[snap]

I don't know if the technique used to make this possible on unixoid
systems is not applicable on windows systems.

Regards, Frank

Aha. Turned out VERSION was coming from the parent. cmd.exe shows:
C:\Documents and Settings\bkw>echo %VERSION%
3.0.5.001


The real versions are:

The stand-alone version:
----------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\bkw>cd \aljex

C:\Aljex>.\zsh.exe
$P$Gecho $ZSH_VERSION
3.0.5-nt-sniff-4.1.1p2
$P$Gecho this is a test |read aa bb cc
$P$Gecho $aa $bb $cc
this is a test
$P$G
----------------


The cygwin version (just updated a minute ago):
----------------
bash-3.2$ zsh
$P$Gecho $ZSH_VERSION
4.3.2
$P$Gecho this is a test |read aa bb cc
$P$Gecho $aa $bb $cc
this is a test
$P$G
----------------


I can't explain why |read didn't work 20 minutes ago in the standalone version and does now, but I'll happily take it. :)

Brian K. White    brian@xxxxxxxxx    http://www.myspace.com/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



Messages sorted by: Reverse Date, Date, Thread, Author