报错 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


相关文章
|
5月前
|
Linux 开发工具
You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofi
linux配置环境变量操作失误出现:/usr/libexec/grepconf.sh: line 5: grep: command not found 的解决办法
208 2
|
7月前
|
Perl
在 `awk` 命令中,`BEGIN { commands }`
在 `awk` 命令中,`BEGIN { commands }`
42 2
|
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报错
383 0
checking build system type... ./config.guess: unable to guess system type/you must specify one
checking build system type... ./config.guess: unable to guess system type/you must specify one
170 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
241 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
165 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” > 在标签内部加上这句
172 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
find: missing argument to `-exec‘ 已解决
find: missing argument to `-exec‘ 已解决
676 0
find: missing argument to `-exec‘ 已解决
find: missing argument to `-exec&#39;
今天使用find命令查找删除文件时,遇到下面错误,这个是因为在{}和\之间必须要有空格,否则会报上面的错。 以前都没有注意到这个细节,特此记录一下。   [root@DB-Server full]#  find  .
1441 0

热门文章

最新文章