[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash: variables inside 'while'
From: |
Gabriel Zachmann |
Subject: |
Re: bash: variables inside 'while' |
Date: |
31 Aug 2001 07:41:27 GMT |
User-agent: |
slrn/0.9.7.0 (Linux) |
Thanks for your quick response.
> This belongs on bash-bug. Followup-To and Mail-Followup-To set.
uh, sorry, you are right, of course.
>
> zach@cs.uni-bonn.de (Gabriel Zachmann) wrote:
> > cat file |
> > while read p l
> > do
> > xx=$p
> > echo xx=$xx
> > break
> > done
> > echo xx=$xx
>
> This is related to entry E4 in the bash FAQ. Each element of a
> pipeline is run in a separate process, so variable settings are in
hm, but why does bash do this differently than ksh?
I quickly checked: with ksh under Solaris, my example works fine.
I also did another search on the NG, and it seems to me that
people trip pretty often over this.
Cheers,
Gab.
--
/---------------------------------------------------------------------\
| And what if all of animated nature |
| Be but organic Harps diversely fram'd, |
| That tremble into thought, as o'er them sweeps |
| Plastic and vast, one intellectual breeze, |
| At once the Soul of each, and God of all? (Samuel Taylor Coleridge)|
| |
| zach@cs.uni-bonn.de __@/' Gabriel.Zachmann@gmx.net |
| web.informatik.uni-bonn.de/~zach __@/' www.gabrielzachmann.org |
\---------------------------------------------------------------------/