[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: search/replace with regexp
- To: linux ILUG <linux-il(at-nospam)linux.org.il>
- Subject: Re: search/replace with regexp
- From: rcs <rasta(at-nospam)RSHELL.ORG>
- Date: Wed, 30 May 2001 12:44:12 +0300
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: <006e01c0e8d8$072ddcc0$aa5796d4@canaan.co.il>; from miki@canaan.co.il on Wed, May 30, 2001 at 10:13:29AM +0300
- Mail-Followup-To: linux ILUG <linux-il@linux.org.il>
- References: <006e01c0e8d8$072ddcc0$aa5796d4@canaan.co.il>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
- User-Agent: Mutt/1.2.5i
You can use sed at the command line.
cat file|sed -e '[[/address/,]/toaddress/]s/this/that/'
address can either be a number like: cat /etc/passwd|sed -e '1s/root/toor/'
or a regex it self like: cat /etc/passwd|sed -e '/^.oot/,/bin/s/tcsh/bash/'
you can add g after the last / for global substitutions, i.e
same word multiple times on one line.
Ben-Nes Michael <miki@canaan.co.il> wrote:
> Hi All
>
> Any one know about good search/replace (text) that accept regexp as pattern
> ?
>
> the one that im using is rpl (great) but it does not support regexp :(
>
> --------------------------
> Canaan Surfing Ltd.
> Internet Service Providers
> Ben-Nes Michael - Manager
> Tel: 972-4-6991122
> http://sites.canaan.co.il
> --------------------------
>
>
>
> =================================================================
> To unsubscribe, send mail to linux-il-request@linux.org.il with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail linux-il-request@linux.org.il
--
http://www.rshell.org
Join #shellcode on EFnet.
rasta@rshell.org
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il