On Thu, May 11 2006, Jerry James wrote:
It would be a piece of cake to whip up a script to fix them all at
once.
[...]
# find . -name \*.txt | replace foo bar
while read i; do
sed "s|$1|$2|g" $i > $i.tmp && mv -f $i.tmp $i
done
find . -name '*.el' -print0 | xargs -0 sed -i~ 's|foo|bar|g'
(with GNU sed version 4.1.2 and GNU find) should do the same. If you
don't have a recent GNU sed, you may use "perl -w -i~ -p -e" instead.
And dired offers (at least in Emacs 22)...
,----[ `C-h k Q' ]
| Q runs the command dired-do-query-replace-regexp
| which is an interactive autoloaded Lisp function in `dired-aux'.
| It is bound to Q, <menu-bar> <operate> <query-replace>.
| (dired-do-query-replace-regexp FROM TO &optional DELIMITED)
|
| Do `query-replace-regexp' of FROM with TO, on all marked files.
| Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
| If you exit (C-g, RET or q), you can resume the query replace
| with the command M-,.
`----
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available |
http://rsteib.home.pages.de/