![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ls while read loop - internal read picking up wrong input | dkieran | Shell Programming and Scripting | 2 | 05-14-2007 03:02 PM |
| While read loop and rsh | 104234 | UNIX for Advanced & Expert Users | 1 | 01-15-2006 11:53 AM |
| Please explain read in a while loop | jerardfjay | Shell Programming and Scripting | 5 | 01-12-2006 10:33 AM |
| input inside while read loop | jhansrod | Shell Programming and Scripting | 3 | 08-13-2005 10:46 AM |
| read inside a while loop | dta4316 | UNIX for Dummies Questions & Answers | 3 | 05-21-2005 10:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need Help : while read loop
hi all,
Can you please help me with this issue ? Code:
while [ cond1 = cond2 ] ####infinite loop
do
cat file1 |while read var1 var2
do
func1 $var1 $var2
done
cat file2 | while read var11 var22
do
func2 $var11 $var22
done
done
and then it picks up the func2 .... but before all the set of values from file2 are read and func2 is executed control is passing to func1 loop but i want the control to go to func1 only when all the set of values from file2 are read and func2 is called .... Warm Regards Last edited by Franklin52; 10-09-2008 at 03:52 AM.. Reason: adding code tags |
|
||||
|
Does func2 call another script?
In that case you can run the script in the background and use the wait command to wait until the background job is complete. BTW the use of cat is redundant, to loop through a file you can do something like: Code:
while read var1 var2 do func1 $var1 $var2 done < file1 |
|
||||
|
the func2 doesnt call any other script
it is a function defined in the same script .. I tried placing wait command but it behaving the same way ... I tried to print values (var11 n var22) but it is printing only 1st set of values picked func2 and control passes to first while loop... If I simply echoed values without passing to func2 all the set of values are printed ... please help me out .... |
| Sponsored Links | ||
|
|