umen
December 23, 2007, 10:31am
1
Hello all
I need to search and replace in multiple files that are in directory hierarchy
Im using the :
f
ind . -name "*.dsp" -print | xargs grep -n -o Test.lib" , I like to be able to
replace every instance of Test.lib
with empty space .
how can I write one liner that does this ?
umen:
Hello all
I need to search and replace in multiple files that are in directory hierarchy
Im using the :
f
ind . -name "*.dsp" -print | xargs grep -n -o Test.lib" , I like to be able to
replace every instance of Test.lib
with empty space .
how can I write one liner that does this ?
find . -name "*.dsp" | xargs -i sed 's/Test.lib//g' {}
drl
December 23, 2007, 6:25pm
3
Hi, shamrock.
Did you mean:
find . -name "*.dsp" | xargs sed -i 's/Test.lib//g'
that is, to supply "-i" to sed as opposed to xargs?
Otherwise, the sed operation will not be written "in place" and the sed output for all files will go to STDOUT ... cheers, drl
umen
December 24, 2007, 3:56am
4
If I may ask another question in this thread, what is I like to search string inside close archive like tar or jar
How should my find command look like ?