Ubuntu SED-“经济对话”;“文件名太长”;关于变量

Ubuntu SED-“经济对话”;“文件名太长”;关于变量,ubuntu,sed,terminal,Ubuntu,Sed,Terminal,我试图修改存储在变量中的json,如下所示: PS:(这个错误也有点被掩盖了,但我尝试了使终端退出的相同过程) 有没有办法避免sed出现这种错误 谢谢这可能适合您(GNU-sed和并行): 将就地并行编辑文件。非常感谢,我认为这很好 #The variable has some information about a json file (around 10 keys). infos = [{"id":512,"hostName":"PC-1&q

我试图修改存储在变量中的json,如下所示:

PS:(这个错误也有点被掩盖了,但我尝试了使终端退出的相同过程)

有没有办法避免sed出现这种错误

谢谢

这可能适合您(GNU-sed和并行):


将就地并行编辑文件。

非常感谢,我认为这很好
#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
parallel sed -i 's/Win10/Ubuntu/g' {} ::: $infos