[SLUG] grep sed

Al Girling al at gcguk.demon.co.uk
Tue Feb 28 15:13:59 GMT 2006


On Mon, Feb 27, 2006 at 04:15:06PM GMT, John Allsopp wrote:
> > john at johnallsopp.co.uk wrote:
> >> grep -l "+44 123 4567" *.php | xargs sed 's/+44 123 4567/+44 765
> >> 4321/g' | tee out.txt

John, I can see how you got this to work, but I'm uncertain about what
you were trying to do with the '| tee out.txt' bit.  I can see how you'd
use grep -l to find all the files containing your string before passing
that list to xargs and doing some sed magic to change the old to new
numbers.  Could you explain where 'tee' fits in please?

Al

-- 
Al Girling

Home page:                  <http://al.sdf-eu.org>
Linux User: #290080         <http://counter.li.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/scarborough/attachments/20060228/0448d160/attachment.bin


More information about the Scarborough mailing list