Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] grep, sed, and cat - oh my!
- Date: Fri, 17 Sep 2010 06:50:27 +0900
- From: Mattia Dongili <malattia@example.com>
- Subject: Re: [tlug] grep, sed, and cat - oh my!
- References: <4C924ACE.9000707@example.com> <20100916170709.GI2124@example.com>
- User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Sep 16, 2010 at 07:07:09PM +0200, Nicolas Limare wrote: ... > > ... and I thought I would need to use "grep" so that my line-replacing > > would happen on multiple files... but does "sed" already act on multiple > > files? > > no. sed works line by line yes, it works on multiple files. mattia@example.com:~> echo 1 > f1; echo 1 > f2 mattia@example.com:~> sed 's/1/2/' -i f{1,2} mattia@example.com:~> grep . f{1,2} f1:2 f2:2 ... > find ./ -name *.html | while read FILE; do sed -i 's%...%...%g' $FILE; done ...| xargs sed '...' -i or just sed 's%la%laala%g' -i /path/to/*.html if all files you want to work on are in the same directory. Read sed's manpage, sed can take backups for you of all the files it changes. -- mattia :wq!Attachment: signature.asc
Description: Digital signature
- Follow-Ups:
- Re: [tlug] grep, sed, and cat - oh my! [SOLVED]
- From: Dave M G
- References:
- [tlug] grep, sed, and cat - oh my!
- From: Dave M G
- Re: [tlug] grep, sed, and cat - oh my!
- From: Nicolas Limare
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] grep, sed, and cat - oh my!
- Next by Date: Re: [tlug] grep, sed, and cat - oh my! [SOLVED]
- Previous by thread: Re: [tlug] grep, sed, and cat - oh my!
- Next by thread: Re: [tlug] grep, sed, and cat - oh my! [SOLVED]
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links