Can't set variables in a while loop that is passed to the rest of the script.

Mark J. Reed markjreed@gmail.com
Fri Jan 15 13:43:00 GMT 2010


On Friday, January 15, 2010, Thomas Wolff  wrote:
> As was responded before, this isn't supposed to work in a pipe. Not in ksh either, I think,

No, it works in real ksh.  If the last command in a pipeline is a
builtin, it is run in the current shell.

$ unset foo bar
$ echo ${foo=hiya} | read  bar
$ echo foo=$foo bar=$bar

the above will set bar but not foo in ksh.  Some shells will set foo
but not bar.  Current bash sets neither.  No shell sets both.

But not Cygwin-related.

-- 
Mark J. Reed <markjreed@gmail.com>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list