3 ms·
I am a perl lover. I fully adhere to the idea that perl (or python or ruby or javascript) should be used instead of sed/awk/sh/grep/find each time we need to go
by webreac 14y ago
I am a perl lover. I fully adhere to the idea that perl (or python or ruby or javascript) should be used instead of sed/awk/sh/grep/find each time we need to go beyond the basic usage of these commands.
I have never said that everybody should know the arcane parts of sed (http://uuner.doslash.org/forfun/sedtris.sed http://uuner.doslash.org/forfun/sedtris.sed). The unix tools work best when they are combined together (with pipes). The basic usage of sed is very useful to combine unix commands. Knowing the basics of standard unix tools has always been a time saver for me. Here is an example of a command that I may need in some unusual cases:
for i in $(awk '/PWP/{print $1}' machines) ; do
echo $i; rsh $i df . ; done
In my case, it does not worth being a script, because I may not have the same need before a month or two. Without unix tools, this would be a pain in the ass.