On Sat, 15 Oct 2005 17:25:35 +0800, kaming
> Dear all,
> It is found that the read Public domain version of ksh can't read variable
> from pipe ...
It's not that it can't read, it's that pdksh behaves like most other
shells: each process in a pipe is a subshell with its own variables,
which are gone when the process ends.
> i.e.
> # echo $KSH_VERSION
> # A="Hello"
> # echo $A | read B
> # echo $B
> However, I found that the above syntax was correctly in commercial version
> of ksh like AIX and Solaris..
> Do any one have idea on how to solve this problem?
echo $A | (read B; echo $B)
Download ksh from kornshell.com or use zsh.
--
The wind doth taste so bitter sweet,
Like Jaspar wine and sugar,
It must have blown through someone's feet,
Like those of Caspar Weinberger. -- P. Opus