lmquang/til

OS X + Sed: “extra characters at the end of l command” Error

Opened this issue · 0 comments

Unlike Ubuntu, OS X requires the extension to be explicitly specified. The workaround is to set an empty string:

$ sed -i '' 's/megatron/pony/g' /path/to/file.txt

Add the -i option to sed to save the result back to input.txt.

https://myshittycode.com/2014/07/24/os-x-sed-extra-characters-at-the-end-of-l-command-error/