unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How do I get global-grep-and-replace to work?
@ 2003-09-26 10:51 Cinnamon
  2003-09-26 13:07 ` Klaus Berndl
  2003-09-29  9:54 ` Jens Schmidt
  0 siblings, 2 replies; 5+ messages in thread
From: Cinnamon @ 2003-09-26 10:51 UTC (permalink / raw)


Hi,

I've a large number of files that need one line changing.

I tried global-grep-and-replace, which asks me what I want to change,
what I want to change this to, and then asks me which files.

I get a neat buffer with all the offending lines in all the files
listed, then it askes me Do you want to [replace, edit, search, quit]:

When I say replace, it moves to the first buffer onto the line, but
instead of changing those lines for me automagically, it just sits
there.  Also, I'm not sure why its actually going into the file and
showing me -- I already said to just replace this with that in *.c, so
no need to show me the files, just go ahead and do it :)

What is going on?  And is there a way I can just coax Xemacs into
changing the lines in those files without any more work for me?

thanks,

Cinnamon

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: How do I get global-grep-and-replace to work?
@ 2003-09-27 17:54 Joe Corneli
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Corneli @ 2003-09-27 17:54 UTC (permalink / raw)


#!/bin/bash

# ;)

# Examples:    

# jed "I have some bad news." "So, how's the weather out there?" *.txt
# jed Cornelli Corneli that_letter.txt

REENTER=`echo "$@"|  sed -e "s/$1 $2 //"`

for FILE in $REENTER
do
  cat $FILE | sed -e "s/$1/$2/g" > p_jed.out
  mv p_jed.out $FILE
done;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-29  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-26 10:51 How do I get global-grep-and-replace to work? Cinnamon
2003-09-26 13:07 ` Klaus Berndl
2003-09-27  1:17   ` Cinnamon
2003-09-29  9:54 ` Jens Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2003-09-27 17:54 Joe Corneli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).