Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk - execution control??

Status
Not open for further replies.

christiniaroelin

Programmer
Sep 15, 2004
26
US
Hi all,
i have two awk seperate statements in a script. But only the first one gets excuted and then exits. i replaced the second one with just a print statement as a test but i find the control not being passed after the excution od the first awk.. is this the normal behaviour of awk or is there a way around it that im missing.

Thank You
roelin
 
it would be helpful to see a sample code.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
As an eample:

case ${channel} in
< case code here>
esac
exec awk -v stream=$channel '{ line[NR] = $0 } END {
i=NR
system( "banner -***********- >> /production/temp/outnlod"stream".dat")
system( "print VALIDATION PERFORMED ON- >> /production/sew/temp/outnlod"stream".dat")
system( "date >> /production/sew/temp/outnlod"stream".dat")
system( "print ------------------------------------- >> /production/temp/outnlod"stream".dat")
while( i > 0) {
system( "globber /production/data*/"stream"/*"line"nlod* >> /production/temp/outnlod"stream".dat" )
i=i-1 }
}' < dates.dat
exec awk '{ if ( ( $0 ~ / files found/) && ( $2 < 10) ) { print $2 " files found " } }' < outnlodl.dat

Thanks
roelin
 
In you shell man page pay attention to the exec builtin.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
are the double (( )) required by any (especially old) awks?
in

exec awk '{ if ( ( $0 ~ / files found/) && ( $2 < 10) ) { print $2 " files found " } }' < outnlodl.dat

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top