I'm sure this is an awesome resource, and I really should check it out since I want to learn more of awk.
That said, I find the initial "appetizer" example a bit contrived. To print all users from /etc/password from the command-line would probably not be done by writing a C program, by most (sane) people.
I would just do "cut -d: -f1 /etc/passwd", which feels simpler than the awk example.
To print all users from /etc/password from the command-line would probably not be done by writing a C program, by most (sane) people.
I used to work with a guy who would have done it that way. I do admit he was not entirely sane.
Personally I'd do it with two or three lines of python rather than awk, even though I theoretically know awk, because it's quicker for me to type the Python than to remember the syntax for the awk (wait, which brackets are which again?).
That's not an argument against learning awk, of course, that's an argument for why I should learn awk slightly better.
That said, I find the initial "appetizer" example a bit contrived. To print all users from /etc/password from the command-line would probably not be done by writing a C program, by most (sane) people.
I would just do "cut -d: -f1 /etc/passwd", which feels simpler than the awk example.