【发布时间】:2018-03-04 01:17:09
【问题描述】:
我正在尝试使用 sed 脚本将 { "index" : {} }\n 添加到 json 文件中。
sed -e 's/^/{ "index" : {} }\n/' -i
/Users/p2s/Desktop/untitled_folder/sku.json
但是我得到一个错误
sed: -i may not be used with stdin
谁能告诉我错误是什么以及如何解决?
【问题讨论】:
-
不要使用 sed 等解析 json。发布您的
sku.json内容 -
sed -i '...' file阅读手册页,在哪里放置选项。