This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]