Subject: Re: [ast-users] Need your advise on loop coding
--------
> 
> Hello Forum,
> 
> I came across of unexpected behavior of while loop reading values from file 
> and 
> calling function which uses while loop to read file as well.
> simple example is below.
> 'while read k' loop should read 3 lines from the file. 
> But instead ... 
> reads only 1st line.
> 
> Can you please help. I show simplified script as an example. I use MKS Tools 
> Kor
> n Shell for windows.
> 
> #set -x
> set -K
> SCRDIR=c:/working/de1/3_26
> 
> F1=$SCRDIR/analyze_scripts1.sh.vie.lst
> 
> function func
> {
> #set -x
> 
> INP_SCR=$1
> F2=$SCRDIR/analyze_scripts1.sh.cur5.lst
> 
> while read  CUR_OBJ
> do
> print "Cur_Obj: $CUR_OBJ"
> if [ $CUR_OBJ = $INP_SCR ];then
>     print "Found the same"
> fi
> done< $F2
> }
> 
> while read k
> do
>     print "===KKKK===: $k"
>     func "$k"
> done < $F1
> 

This looks like an MKS Toolkit bug.  If you can reproduce the problem
with UWIN we will fix it.

David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to