I’m trying to replace all occurrences of -> with .. I’ve tried the following:
sed -i s/->/./g licensewizard.cpp
But this gives me an error:
sed: -e expression #1, char 3: unterminated `s' command
I’m not sure what’s wrong since neither - nor > need to be escaped if I’m not mistaken?
You need to single quote your sed commands so that the shell wont try to interpret any of the chars. In this particular instance, your shell was interpreting the
>character to attempt a redirection.