Help!<br>
<br>
I've been working on this for the past few days and couldn't get this to work. I wrote a function InRange which returns a 1 if a time is within the range of another time. It works when I test it out with a body inside the inrange.awk script:<br>
<br>
cat b ¦ awk -F" " -f inrange.awk -<br>
<br>
where b contains one line with the time: 12 00 14 23 59 24 16 00 00<br>
The first three number is the starting time 12:00:14 and the next three is the end time 23:59:24. The function will check to see if the time 16:00:00 lies between the starting and ending time. awk -F" " separates all the numbers into variables $1, $2, $3... inrange.awk contains the function definition and a body for execution:<br>
{ print "Function returns", InRange($1,$2,$3,$4,$5,$6,$7,$8,$9) }<br>
<br>
When I execute the above script, it works fine. All outputs are as anticipated.<br>
<br>
But what I was required to do is:<br>
<br>
cat b ¦ awk -F" " -f inrange.awk '{ print "Function returns", \<br>
InRange($1,$2,$3,$4,$5,$6,$7,$8,$9) }'<br>
<br>
I want to be able to generate the file b (or echo it in on the fly) and change the execution body when needed dynamically. The function in inrange.awk is too large to put it all in the command line. The result of the above execution shows nothing. I see no output from the print command even if I don't call the InRange function. There are no errors either. Does anyone know a way to do this or have similar functions already written? Many thanks for your help.<br>
<br>
Thanks again,<br>
Benjamin<br>
<A HREF="mailto:benjaminle@engineer.com">benjaminle@engineer.com</A>
<br>
I've been working on this for the past few days and couldn't get this to work. I wrote a function InRange which returns a 1 if a time is within the range of another time. It works when I test it out with a body inside the inrange.awk script:<br>
<br>
cat b ¦ awk -F" " -f inrange.awk -<br>
<br>
where b contains one line with the time: 12 00 14 23 59 24 16 00 00<br>
The first three number is the starting time 12:00:14 and the next three is the end time 23:59:24. The function will check to see if the time 16:00:00 lies between the starting and ending time. awk -F" " separates all the numbers into variables $1, $2, $3... inrange.awk contains the function definition and a body for execution:<br>
{ print "Function returns", InRange($1,$2,$3,$4,$5,$6,$7,$8,$9) }<br>
<br>
When I execute the above script, it works fine. All outputs are as anticipated.<br>
<br>
But what I was required to do is:<br>
<br>
cat b ¦ awk -F" " -f inrange.awk '{ print "Function returns", \<br>
InRange($1,$2,$3,$4,$5,$6,$7,$8,$9) }'<br>
<br>
I want to be able to generate the file b (or echo it in on the fly) and change the execution body when needed dynamically. The function in inrange.awk is too large to put it all in the command line. The result of the above execution shows nothing. I see no output from the print command even if I don't call the InRange function. There are no errors either. Does anyone know a way to do this or have similar functions already written? Many thanks for your help.<br>
<br>
Thanks again,<br>
Benjamin<br>
<A HREF="mailto:benjaminle@engineer.com">benjaminle@engineer.com</A>