View Single Post

  #2 (permalink)  
Old 04-17-2006, 12:31 AM
monk's Avatar
monk monk is offline
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

In string http:// double slash (//) confuses sed, as they are part of sed syntax. You need to replace // with \/\/ to disable its special meaning. For example:

Code:
URL="http://old.com"
olddomain="old.com"
newdomain="new.com"
echo $URL | sed "/http:\/\//s/$olddomain/$newdomain/g"
Modify your script and it should work now
Reply With Quote