PROBLEM
When executing the following command on OS X…
1
sed
-i
's/megatron/pony/g'
/path/to/file
.txt
… the following error occurs:-
sed: 1: "/path/to/file.txt": extra characters at the end of l command
SOLUTION
Unlike Ubuntu, OS X requires the extension to be explicitly specified. The workaround is to set an empty string:-
1
sed
-i
''
's/megatron/pony/g'
/path/to/file
.txt
… and now, Megatron has transformed into a pony.
Comments
Post a Comment
https://gengwg.blogspot.com/