You needed braces around your code block while() { code here } and you would need to fork to awk with system (most likely). I may not even understand the question.
UPDATE: You may want to slow down the posting a little. It looks like you asked this question in "Re^2: pass variable to another process when invoking from command line" already. Also, since "scripting probs" seems to be related as well, it might pay off to read "How (Not) To Ask A Question." I bet you could have combined all these into one if you asked everything at once.
-Paul
In reply to Re: shell prob
by jettero
in thread shell prob
by vineet2004
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |