I’m trying to use sed in a shell script in Applescript to strip this string – ?print=1 – from this html link in the variable the_html, which is <a href="http://myurl.com.html?print=1">my link</a>
but this throws an error:
set new_html to do shell script "echo " & quoted form of the_html & " | sed s=?print=1= =g'"
Do I need to escape the “=”?
Edit:
Works now. Applescript didn’t like an = escaped with a \, but escaping the whole string works:
sed 's/?print=1//g'
Try this:
Comments:
sed, you generally use slashes: ‘s/a/b/’