Re:Awk by example, Part 1 --
by silentbicycle on Thursday June 03, 2010 @11:23PM
(#1403376)
_The Awk Programming Language_ is vastly better, IMHO, and half the size. Brian Kernighan co-wrote it. It's that good.
The awk chapters in Bentley's _Programming Pearls_ and _More Programming Pearls_ and Peteris Krumins's Awk One-Liners series (http://www.catonmat.net/blog/awk-one-liners-explained-part-o...) are worth a read, as is the source for awk. (nawk, at least - haven't looked at gawk).
http://books.google.com/books?id=m4ZzElQZxcoC&dq=sed+awk...
The awk chapters in Bentley's _Programming Pearls_ and _More Programming Pearls_ and Peteris Krumins's Awk One-Liners series (http://www.catonmat.net/blog/awk-one-liners-explained-part-o...) are worth a read, as is the source for awk. (nawk, at least - haven't looked at gawk).
Needs to be
$ awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd
Really nice introduction to awk. I've been meaning to dig a bit deeper into it and this is straightforward and easy.