What I'm trying to accomplish is
0) Ask the user for a URL ex.
http://thisIsATest/homepage/blah.html and grab it's contents and store it.
1) Take that URL and strip off anything for the last '/'
2) Then append 'images/' to the end of the URL
3) And finally use the sed command to search for any image paths ex. images/spacer.gif and replace it with the URL in step #2
Currently I'm stuck at Step3 and can't get it to do the search and replace correctly. It either inserts it as ${S} or I error out with bad flag in substitute command: '/'
Code:
#!/bin/bash
USERADOBE='someUser'
PWADOBE='somePass'
echo ""
read -p "Enter/Paste the URL >> " myURL
cd $HOME/Desktop
curl "${myURL}" -u "${USERADOBE}":"${PWADOBE}" > editedHTML.html
t=${myURL%*/*}
echo "$t"
s="${t}""/images/"
echo "$s"
#sed -e 's/images\/'/${s}'/' >> editedHTML.html
sed -e 's/images\//'"${s}"'/' editedHTML.html >> blah.html