On Tuesday 28 October 2008 23:34:31 Jorge Peixoto de Morais Neto wrote: > > Run autounmask, it creates a new file in /etc/portage/package.unmask/ > > > > Run a quick awk on it to get it into shape > > > > Move file to /etc/portage/package.mask/ > > > > Problem solved in a neat elegant insightful way. > > 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 -- alan dot mckinnon at gmail dot com