This is the mail archive of the
cygwin
mailing list for the Cygwin project.
cont'd - RE: 1.5.9: Trouble with setting variables using 'read' in a script
- From: "Jan Schormann" <Jan dot Schormann at BrainLAB dot com>
- To: <cygwin at cygwin dot com>
- Date: Thu, 6 May 2004 16:21:26 +0200
- Subject: cont'd - RE: 1.5.9: Trouble with setting variables using 'read' in a script
- Reply-to: <Jan dot Schormann at BrainLAB dot com>
(Please excuse the unfinished last mail, I hit "Ctrl-Enter"
by accident.)
> - echo "text" | read var ; echo $var
> - cat file | read var ; echo $var
> - read var < file | echo $var
.. continuing from last time, all of these won't work
because you're always creating a new subshell.
Try
read var < file ; echo $var
Cheers,
Jan.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/