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