>> awk? I assumed it was an obsolete language included for compatibility. >> People should use Python, Perl, or sed's "s" command. Am I wrong? > > Yes. You are indeed wrong. > > Python and Perl are humungous interpreters that rival Java for size. Perl is > in a class of it's own for syntax bloat. > > sed is neat but has nowhere near the functionality of awk. > > For example, I recently needed to scan a massive text file of 89000+ lines and > count the number of character on each line and print it out with the line > number. A bash script took 20 seconds to run. A C script took less than half > a second. An awk script was marginally *quicker*. Granted, most of that time > is spent writing to the console, but the text processing must then also be on > par with C. > > awk is not obsolete, it's just been around for a while. It's no more obsoleted > by perl, python and sed than ls is obsoleted by the existence of gui file > managers Nice. I might learn it in the future (there are some urgent duties I must to before, and then I want to learn C* and Python**. Then I may study awk)
* Before you ask "what, you don't know C?", I mean to really know C, that is, read a rigorous book such as "C: A Reference Manual" and be able to write portable programs with well-defined behavior. Speaking of well-defined behavior, do you know what happens when you cast a float to an int, and the float is too big to fit into the int? ** I know basic Python, but I think Python is nice enough for a person to *really* know it. -- Software is like sex: it is better when it is free - Linus Torvalds