This is one for you sed gurus out there. I really don’t know enough about sed to take this apart completely. It was written on some standard Linux distro and I need it to run on OSX.
COMPILE_FILES=$(sed -nr '/<script type="text\/javascript"/ { s%^.*src="\{\$baseUrl\}/([^"]+)".*$%\1%p }' templates/common/minifiedScripts.tpl)
The first thing is that the r flag doesn’t exist on the OSX version of sed. I thought the equivalent is -E, so changed it. But then I get:
sed: 1: "/<script type="text\/ja ...": bad flag in substitute command: '}'
Thanks!
OS X
seddoesn’t like multiple commands run together using semicolons or grouped in curly braces (which aren’t necessary in the command you have). Try this:If you have a
sedscript that consists of multiple commands, you’ll have to break them up using-e: