[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: contents of whole arrays dissapears leaving while read loop
From: |
Greg Wooledge |
Subject: |
Re: contents of whole arrays dissapears leaving while read loop |
Date: |
Thu, 26 Mar 2009 08:13:03 -0400 |
User-agent: |
Mutt/1.4.2.2i |
On Thu, Mar 26, 2009 at 10:38:20AM +0100, Jan Schampera wrote:
> Lennart Schultz wrote:
> > cat file|while read line
> > do
> > done
> How to do it instead?
> http://bash-hackers.org/wiki/doku.php/syntax/expansion/proc_subst
In this case, he doesn't need a process substitution -- he's just
reading from a file.
while read line; do
...
done < file
is all that's required. (Yes, the process substitution will be
helpful in some of the more demanding problems.)