I am trying to make the following changes to my files:
grep -rl 'arg_1 :' . | xargs sed -i 's/arg_1 :/arg_1:/g'
That is, I am looking to replace arg_1 :
with arg_1:
However when I run this same argument, I get the following error:
sed: 1: "./ua/uaosfamily.md": invalid command code .
If I replace. by the absolute path, I get the following error:
sed: 1: "/Users/josemanueldefrut ...": invalid command code j
I understand that in passing. as an argument it is not evaluated as the absolute path and therefore the fault arises. Could someone explain to me why this happens and how can it be solved?
CodePudding user response:
Indeed it is what was commented previously. It seems that sed on mac has a different syntax. It seems that this question was already asked.
sed command with -i option failing on Mac, but works on Linux