sed: 1: "xxx.cfg": command a expects \ followed by text

github上的原文:sed command with -i option failing on Mac, but works on Linux

不是最佳方案,但比较好,-i''可以直接覆盖,不用创建备份。

This works with both GNU and BSD versions of sed:

sed -i'' -e 's/old_link/new_link/g' *

or with backup:

sed -i'.bak' -e 's/old_link/new_link/g' *
相关文章
添加新评论
取消评论
*
*
*
勇士!消灭0条评论,这么艰巨的任务就靠你了!