_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).
10 comments
[ 6.5 ms ] story [ 52.3 ms ] threadReally nice introduction to awk. I've been meaning to dig a bit deeper into it and this is straightforward and easy.
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