报错 sed: 1: extra characters at the end of d command

简介: 报错 sed: 1: extra characters at the end of d command

错误描述

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

参考

mac 执行sed -i指令时,总是出现extra characters at the end of command


相关文章
|
6月前
|
Perl
在 `awk` 命令中,`BEGIN { commands }`
在 `awk` 命令中,`BEGIN { commands }`
36 2
|
6月前
|
Python
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
|
Java
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
366 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
231 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
158 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
找到你项目中 .idea/workspace.xml文件 找到 < component name=“PropertiesComponent” > 在标签内部加上这句
166 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
find: missing argument to `-exec‘ 已解决
find: missing argument to `-exec‘ 已解决
655 0
find: missing argument to `-exec‘ 已解决
find: missing argument to `-exec&#39;
今天使用find命令查找删除文件时,遇到下面错误,这个是因为在{}和\之间必须要有空格,否则会报上面的错。 以前都没有注意到这个细节,特此记录一下。   [root@DB-Server full]#  find  .
1431 0