我试图用sed在AppleScript的shell脚本剥夺这个字符串 - 打印= 1 - 从变量the_html这个网站的链接,这是<a href="http://myurl.com.html?print=1">my link</a>
SED和AppleScript shell脚本 - 带字符串
但这会引发错误:
set new_html to do shell script "echo " & quoted form of the_html & " | sed s=?print=1= =g'"
我需要转义“=”吗?
编辑:
现在工程。 AppleScript的不喜欢的=用\
逃脱,但逃脱整个字符串的工作原理:
sed 's/?print=1//g'
谢谢,但我忽略了提醒,我在Applescript中使用shell脚本,并且Applescript不喜欢\以逃避=。 – markratledge 2010-11-21 19:31:42