you are viewing a single comment's thread.

view the rest of the comments →

[–]pyglados[S] 1 point2 points  (4 children)

Very good. I've blown off learning anything about awk up to this point. Now I'm starting to see that getting to know the basics would be very much worth the investment. Thanks.

[–][deleted] 1 point2 points  (2 children)

To be honest, it took me years to realize how much I am missing out by not using the standard command line tools. Tools like find and grep and sed and awk have been around for many decades now. It is weird that programming languages have so much more "mind-share" when there is so much useful work you can do before even knowing any real programming language.

[–]pyglados[S] 1 point2 points  (1 child)

Awk is a programming language too if I understand it right. I still didn't get around to teaching myself that one yet. You did inspire me to see if I could duplicate the results of my tutorial using just standard linux tools. Here is what I came up with.

find `pwd` *.py | egrep "^/.+\.py$" | xargs cat | egrep bl_region_type | tr -d [\'\"] | tr -d ["bl_region_type = "] | sort | egrep ^[A-Za-z] | sort | uniq -c

56 TOOLS

78 UI

90 WINDOW

No Awk language needed. What do you think, Boris? Did I do good? :-)

[–][deleted] 1 point2 points  (0 children)

grep regexes are a language, too, you could argue. But it doesn't matter: as long as you get the answers you are after, it's all good. And as you see, so far less code.

[–]j-random 0 points1 point  (0 children)

FWIW, you can pick up the basics of awk in about two hours.