我的问题是,我正在尝试使用grep和Terminal在文本文件中快速搜索结果。命令
grep -F http://myurl.com/whatever urldocument.txt
根据需要返回带有URL的行。令人沮丧的是,使用Applescript获得结果
tell application "Terminal"
do shell script "grep -F http://myurl.com/whatever urldocument.txt"
end tell
会中断,因为在运行Applescript时,grep
由于某些原因会忽略(某些?)命令,特别是-F
部分。我的问题是:为什么会这样,我能做些什么?