错误描述
在macOS 上执行sed命令,报错
sed -i 's/book/books/g' demo.txt sed: 1: extra characters at the end of d command
解决方法
原因是mac的和linux写法不一样
# linux sed -i 's/book/books/g' demo.txt # mac sed -i '' 's/book/books/g' demo.txt
参考
在macOS 上执行sed命令,报错
sed -i 's/book/books/g' demo.txt sed: 1: extra characters at the end of d command
原因是mac的和linux写法不一样
# linux sed -i 's/book/books/g' demo.txt # mac sed -i '' 's/book/books/g' demo.txt
参考