From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joe Corneli Newsgroups: gmane.emacs.help Subject: Re: How do I get global-grep-and-replace to work? Date: Sat, 27 Sep 2003 12:54:01 -0500 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1064685419 5133 80.91.224.253 (27 Sep 2003 17:56:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 27 Sep 2003 17:56:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 27 19:56:57 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A3JJR-0003Vq-00 for ; Sat, 27 Sep 2003 19:56:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A3JHI-0005gG-ID for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Sep 2003 13:54:44 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A3JGe-0005eG-Js for help-gnu-emacs@gnu.org; Sat, 27 Sep 2003 13:54:04 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A3JGd-0005df-6n for help-gnu-emacs@gnu.org; Sat, 27 Sep 2003 13:54:03 -0400 Original-Received: from [146.6.139.124] (helo=dell3.ma.utexas.edu) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A3JGc-0005cz-OV for help-gnu-emacs@gnu.org; Sat, 27 Sep 2003 13:54:02 -0400 Original-Received: from linux183.ma.utexas.edu (linux183.ma.utexas.edu [146.6.139.172]) by dell3.ma.utexas.edu (8.11.0.Beta3/8.10.2) with ESMTP id h8RHs1f20002; Sat, 27 Sep 2003 12:54:01 -0500 Original-Received: from jcorneli by linux183.ma.utexas.edu with local (Exim 3.36 #1 (Debian)) id 1A3JGb-0006L7-00; Sat, 27 Sep 2003 12:54:01 -0500 Original-To: help-gnu-emacs@gnu.org .References: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12837 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12837 #!/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;