[NBLUG/talk] command line search/replace

S. Saunders sms at sonic.net
Tue Nov 7 08:04:48 PST 2006


On Sat, November 4, 2006 07:50, Barry Stump wrote:

> I found the hard part with grep is to make the process interactive for
> each match, rather than each matching file.  Vim makes this easy with
> the /c switch for the substitute command.

<nod>

Thing about scripting is, it's usually a quick-and-dirty method, go with
what you know.  Sed (I believe) offers the same switch and is usually the
preferred choice for scripting.

Invoking vim each time is less-efficient, but in our bloatware days (where
64M isn't enough for most Linuxes -- remembering that the original IBM
PC's used to have 64*K* of RAM!), this sort of "inefficiency" is less and
less worth "fixing".


- Steve S.





More information about the talk mailing list