Questions tagged «json»

4
Bash CLI从命令输出中删除引号
我正在尝试使用jqper here加载JSON文件。这非常简单,并且有效: $ cat ~/Downloads/json.txt | jq '.name' "web" 但是,我需要将此变量的输出分配给命令。我试图做到这一点,这工作: $ my_json=`cat ~/Downloads/json.txt | jq '.name'` $ myfile=~/Downloads/$my_json.txt $ echo $myfile /home/qut/Downloads/"web".txt 但是我要/home/qut/Downloads/web.txt。 如何删除引号,即"web"改为web?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.