Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find command and editing

Status
Not open for further replies.

steenb

Technical User
Apr 25, 2001
31
0
0
DK
hi
I want to edit as a part of a find command :
find . '*.sql' -exec sed -e 's/abc/dce/' {} \;

but this just std outputs the changed lines.
is a commandfile and ed best option instead of sed
or is there an easier way to do this ?
TIA
SteenB
 
hi ,

you can do something like this :-

for i in `ls *.sql`
do

sed -e 's/abc/dce/' < $i >$i.$$
done

creates new file with changes in $i.$$ ( $$ pid number)

HTH
 
fine idea
the `ls *.sql` could also be my find or anything else for that sake.
thx
SteenB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top