1
殼這個字符串,這是我的代碼:如何更換使用ubuntu上
sed -i "s/tttt/<img src=\"{% media_url '/images/line.gif' %}\" width=\"100%\" height=\"1\" />/g" *.html
我想用shell來改變tttt
到<img src="{% media_url '/images/line.gif' %}" width="100%" height="1" />
,
但字符串有""
和''
,所以我不能使用像這樣:
sed -i 's/old-word/new-word/g' *.txt
我不喜歡這樣寫道:
sed -i 's/\"old-word\"/\'new-word\'/g' *.txt
但它顯示錯誤:
sed:-e expression # 1, character 35: "s" unknown option ↵
所以我可以做什麼,
感謝
投遞**它顯示錯誤**,這是一個好主意,包括錯誤... – forsvarir 2011-05-12 07:59:41