Mathematica中文论坛-非官方

标题: 豆粑粑 macos sed -i extra characters at the end 问题的解决 [打印本页]

作者: meatball1982    时间: 2020-3-26 21:01
标题: 豆粑粑 macos sed -i extra characters at the end 问题的解决

在macos 下,用sed 删除一个文件的第一行。

  1. sed -i  '1d'  your_file.txt
复制代码


然后,就出问题了。
  1. sed: 1: "your_file.txt": extra characters at the end of n command
复制代码


查了一下,macos 的sed导致的

解决,只要加一个      ' '      就行了 。

sed -i '' 's/megatron/pony/g' /path/to/file.txt





欢迎光临 Mathematica中文论坛-非官方 (http://ilovemathematica.com/) Powered by Discuz! X3.2