[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bash - Readline in nested whiles?




cat list.txt
a
b

while read r; do echo $r; done  < list.txt;
a
b

x=0; while read r; do while [ $x -lt 3 ]; do let x=$x+1; echo $r; done; done < lista.txt ;
a
a

Why not the output is? Can't be nested while when reading line?
a
a
a
b
b
b

Any comment will be preciated.




--
----------------------------------------------------------------------
"You don't know where your shadow will fall", Somebody.-
----------------------------------------------------------------------
Ing. Olaf Reitmaier Veracierta <olafrv@gmail.com>
----------------------------------------------------------------------
http://olafrv.googlepages.com (Personal Webpage) ----------------------------------------------------------------------


Reply to: