[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: bi



On Fri, 11 Apr 1997, Rick wrote:

> What is it that is so special about vi?  Does it decompile programs or write
> them all by itself or leap tall buildings with a single bound?

I get calls from users all the time asking "How do I search and replace in
my file?"  9 times out of 10, they are using pico, which has to be the
most brain dead editor ever created.  I always tell them, use vi, and
then:

:g/search-regexp/s//replace-string/g

Voila.  Takes about 3 seconds to type it and change every instance of some
expression in an entire file.  Could be handy if you suddenly realize that
you've been misspelling some guy's name throughout your 50 page thesis.

I tell them to use vi, they wretch, much like you seem to be.  They ask if
there's something else.  I then tell them:

perl -pi.bak -e 's/search-regexp/replace-string/g' filename

...  and then they go into convulsions.  Then they waste a bazillion years
ftp'ing their file to their Windoze box, make the changes using Notepad,
and then ftp it back in binary mode, thus munging the end of lines, and
then call me again for help, asking why there are all of these funny ^M's
on the end of their lines.  Argh.

Jason Costomiris                 | Finger for PGP 2.6.2 Public Key
jcostom@sjis.com                 | "There is a fine line between idiocy
My employers like me, but not	 | and genius.  We aim to erase that line"
enough to let me speak for them. |			--Unknown

	        	http://www.jasons.org/~jcostom


Reply to: