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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling script 1

Status
Not open for further replies.

jo90

Programmer
Jun 19, 2002
30
0
0
GB
Hi,

Is there a way within an awk script to call another script; like in ksh?

something like...

./script

Thanks,
Jo.
 
nawk -f myAwk.awk

#----------------- myAwk.awk
BEGIN {
"date" | getline myDate;
close("date");
print("Current date->[%s]\n", myDate);
}


vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Hi Vlad,

Thanks for the reply - however I need to call the script from within another awk script... not from the command line or from another shell script....

Jo
 
I don't understand WHY my &quot;hint&quot; doesn't do it for you.
Could you show a sample of our flow of control, pls! vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
sure;

END{
if (var1 < var2)
print &quot;there are &quot; var1 &quot; invalid entries&quot;
nawk -f /tmp/scripts/script
}

the script called script, I need to call in the eventuality that (var1 < var2)
 
END{
if (var1 < var2)
print &quot;there are &quot; var1 &quot; invalid entries&quot;
# either
&quot;nawk -f /tmp/scripts/script&quot;
# OR
system(&quot;nawk -f /tmp/scripts/script&quot;)
}

# as in my original &quot;hint&quot; ;) vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Thanks for you help Vlad... works fine, apoligies for not picking up on the hint....

jo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top