Run AWK script on contents of a variable
I have an AWK script (tiny, nothing special, passed on command line) that I want to run with the contents of a variable instead of the contents of a file. How can I do this? It seems like it should be really simple, but I've been trying for hours!
Thanks! |
Maybe something like
Code:
echo $my_var | awk -f script.awk |
As always, I figured it out right after posting. Unless someone knows a better way than doing:
echo "$var" | awk '{script}' ? |
Jeepers!
Holy cow!
/me facepalm I've got a script I've been working on for a week or so, and I kept scratching my head on something similar! Thanks guys! |
All times are GMT -5. The time now is 11:24 PM. |