【发布时间】:2010-11-22 06:18:29
【问题描述】:
我正在尝试在 Applescript 的 shell 脚本中使用 sed 从变量 the_html 中的这个 html 链接中剥离这个字符串 - ?print=1 - <a href="http://myurl.com.html?print=1">my link</a>
但这会引发错误:
set new_html to do shell script "echo " & quoted form of the_html & " | sed s=?print=1= =g'"
我需要转义“=”吗?
编辑:
现在工作。 Applescript 不喜欢用 \ 转义的 =,但转义整个字符串是可行的:
sed 's/?print=1//g'
【问题讨论】:
标签: sed applescript