I am using this sed command on Linux, to patch one file, and it works fine:
sed -i -r "s/(\tpublic function __call.*)/\1\n\t\treturn null;/" rb.php
But when I try this command on OS X, I am getting an error:
sed: 1: "s/(\tpublic function __ ...": \1 not defined in the RE
So, can anybody help me to make command that will work both on Linux and OS X?
By the way, I tried command like:
sed -i '' -r "s/(\tpublic function __call.*)/\1\n\t\treturn null;/" rb.php
but it doesn't work on Linux.