[conspire] vim vs sed awk and grep + interactive vs automation [was Re: Slice of life]
Rick Moen
rick at linuxmafia.com
Mon Sep 21 15:19:56 PDT 2009
Quoting Tony Godshall (tony at of.net):
> A better sed than sed:
>
> perl -i -pe 's{}{}'
Yes, I keep hearing (on reliable authority) that I could junk all of sed,
awk, find, xargs, egrep, and my friend the Bourne data mill using perl,
and gain a single regex implementation at some cost in RAM. I don't
find the syntax cleaner in general, and the alleged speed advantage
often isn't there. But I do believe the point, that it has advantages
in a number of areas.
However, the point is that I am already decently good with sed, awk,
find, xargs, egrep, and my friend the Bourne data mill, and haven't yet
bothered to learn similar proficiency with Perl. So, until I hit parts
of the problem space where my current main tools prove to be blunt
instruments, I keep using them.
> One thing you haven't mentioned but is very useful is that when using
> vim or other interactive tool to edit is that you might realize after
> editing you want to automate: use version control (cvs, git, watever)
> diff.
My change control request did include a "cvs diff [blah]" step, to
double-check the work just before check-in.
I also typically do "cvs log [blah] | grep head" to find the current
repository head version, which then gets cited in the backout procedure.
> [1] There is actually a "rational subset"[2] of perl that's actually
> quite readable.
Yes, indeed. Nick Moffitt (also on this mailing list) was actually the
first Perlista whose code I could consistently read, because he writes
C-like Perl, bless him. Before I saw his scripting, I was worried I'd
never learn to understand the damned stuff.
More information about the conspire
mailing list