【发布时间】:2011-06-21 17:05:55
【问题描述】:
这是为您提供的 sed 专家。我真的对 sed 了解得不够多,无法完全分解。它是在一些标准的 Linux 发行版上编写的,我需要它在 OSX 上运行。
COMPILE_FILES=$(sed -nr '/<script type="text\/javascript"/ { s%^.*src="\{\$baseUrl\}/([^"]+)".*$%\1%p }' templates/common/minifiedScripts.tpl)
第一件事是 r 标志在 OSX 版本的 sed 上不存在。我认为等效的是-E,所以改变了它。但后来我得到:
sed: 1: "/<script type="text\/ja ...": bad flag in substitute command: '}'
谢谢!
【问题讨论】:
-
Dangit,我投票结束了错误的问题。请忽略我对这个问题的近距离投票,并关闭the other one 作为一个副本。
标签: macos shell command-line sed