On Tue, 22 Jul 2008 06:01:16 David C. Rankin wrote:
Listmates,
I'm always looking for easier ways to do things and pass along worthwhile epiphanies as they occur. For the gurus, this is child's play, but I can recall parsing config files as a newbie and I always wanted to get rid of the comments and just look at the active config parameters. At that time, grep, sed, awk and the like just looked like word fragments from a foreign language.
I can relate to that. For me it still does...
Continuing in that tradition, here is another post concerning making it easy to parse config files to get to the "beef". From the command line, a great one-liner that will do this is:
Command Line: sed -e '/^[/s]*$/d' -e '/^\s*[#;]/d'
Nobody wants to type "sed -e '/^[/s]*$/d' -e '/^\s*[#;]/d'
Now when you want to parse a config file, it is as easy as:
nc filename
See? I always 'sed' it was a powerful tool, if only one knew how to use it...;-) Seriously, thanks Dave for another Really Useful Post. This one definitely gets filed away in my toolbox. :-) -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au =================================================== There were in this country two very large monopolies. The larger of the two had the following record: the Vietnam War, Watergate, double- digit inflation, fuel and energy shortages, bankrupt airlines, and the 8-cent postcard. The second was responsible for such things as the transistor, the solar cell, lasers, synthetic crystals, high fidelity stereo recording, sound motion pictures, radio astronomy, negative feedback, magnetic tape, magnetic "bubbles", electronic switching systems, microwave radio and TV relay systems, information theory, the first electrical digital computer, and the first communications satellite. Guess which one got to tell the other how to run the telephone business?