A quick fix is to prepend your string expression with an empty string:
For example: instead of
sed -i s/foo/bar/g text.txt
write:
sed -i s/foo/bar/g text.txtThis should work across different OS (Linux, MacOS, Windows)
--dopexxx来源:http://stackoverflow.…