I'm writing a script in bash that would replace old-link-url to new-link-url my problem is that sed can't replace the url because of the slashes. If i put just some text it works.
sed -e s/"$old_link"/"$new_link"/g wget2.html > playlist.txtAnswer1:
sed supports <em>any</em> character as separator, so if the pattern you are trying to replace contains
/, use a different separator. Most commonly used are
sed 's|foo|bar|g' input sed 's#foo#bar#g' inputAnswer2:
Don't forget to put
double quotes if you are using
sed substitution. Also, if your variable have
/ then use a different delimiter for
sed. You can use
# and many more.
So may be something like this would work -
sed -e "s_"$old_link"_"$new_link"_g" wget2.html > playlist.txt