【发布时间】:2021-08-28 08:49:54
【问题描述】:
我正在尝试修改存储在如下变量中的 json:
PS:(这个错误也被 here 覆盖了,但我尝试了相同的过程使终端退出)。
#The variable has some information about a json file (around 10 keys).
infos = [{"id":512,"hostName":"PC-1","pcModel":"Dell","diskType":"Samsung:...}]
#I want to modify the key where "Win10" is written and replace it with "Ubuntu" like this
sed -i "s/Win10/Ubuntu/g" "$infos"
#Then I get the error
bash: /bin/sed: Argument list too long
sed 有没有办法避免这个错误?
谢谢
【问题讨论】: