【发布时间】:2014-10-27 05:25:52
【问题描述】:
我正在尝试使用 sed 将文本插入文件的第三行,我在其他论坛上找到的语法是:
sed -i '' "3i\ text to insert" file
然而,当我使用这个时,我得到一个错误:
sed: 1: "3i\ text to insert": extra characters after \ at the end of i command
我似乎无法弄清楚是什么导致了问题。我正在使用 OSX,这就是为什么我有一个空的 ' ' 作为我的扩展名。
谢谢!
【问题讨论】: