[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: awk - Read file inside script.
From: |
Chris Jones |
Subject: |
Re: awk - Read file inside script. |
Date: |
Tue, 06 Jan 2009 19:51:31 -0500 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Quick update:
I read a nice awk tutorial and part of the official gawk manual .. and I'm
quite sure now that the reason my script was hanging was that I didn't code an
exit statement at the end of my BEGIN stanza.. which means that since I was
running it as:
$ script
.. rather than:
$ script < input_file
It must have been waiting for me to feed him something from the keyboard.
For future reference - and even if I know zip about awk .. I strongly
recommend this excellent hands-on tutorial:
http://www.grymoire.com/Unix/Awk.html
Takes about an hour to read, is very well-structured and clearly written ..
only briefly mentions the "/pattern/ {action}" feature that other tutorials
confuse you with extensively right from the start.. etc.
In my particular case, it gave me enough of a "feel" for awk programming that
with no forensic evidence I was able to figure out what my problem was.
Thanks!
CJ