Hello David, forum,

I think I found the problem but still have a question.
Here I attach text file. Do not worry - no viruses or anything like that.
This file has 3 lines.
When I run below, it shows 1st line only. 
What's so unusual about this file I do not get it.

while read k
do
print $k
done < ./analyze_scripts1.sh.vie.lst



Thank you,
 
Gene Golub


> Date: Wed, 27 Mar 2013 17:23:57 -0400
> From: [email protected]
> To: [email protected]
> Subject: Re: [ast-users] Need your advise on loop coding
> 
> 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
                                          
ÿþc:/working/de1/3_26/rootdir/QC16411_RDS.vRDSRAMPositionData.sql

c:/working/de1/3_26/rootdir/QC18937_02_Client.vMarginGroupDetails.sql

c:/working/de1/3_26/rootdir/QC19927_MHSecurity.vw_ConstituentSecurityCodes.sql

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

Reply via email to