当前位置:网站首页>Shell reads the value of the JSON file
Shell reads the value of the JSON file
2022-06-28 20:04:00 【51CTO】
json file profile.json
get data
# The first pipe removes commas from each line ; Remove the second pipe { and }; The third pipe removes all double quotes ; The fourth pipe replaces the first : by = Number
data
=
$(cat profile.json | sed -r
's/",/"/'
| egrep -v
'^[{}]'
| sed
's/"//g'
| sed
's/:/=/1'
)
# If json If there is no newline character in the value of, use the following method to obtain
#data=`cat data.json |sed 's/,"/\n/g' |grep -v IAM_Server |sed 's/":"/=/g;s/"$//g;s/^{"//g;s/"}//g'`
declare
$data
# Declare variables
echo
$Mysql_Port
# View variable values
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.

边栏推荐
- Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
- Judge whether the string is empty
- SQL server2019 create a new SQL server authentication user name and log in
- 2788.Cifera
- C # application interface development foundation - form control
- R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions
- Bayesian inference problem, MCMC and variational inference
- 为什么C语言用使用其他文件的结构体变量时,声明结构体别名还不行,必须使用本名?(使用别名时不能加struct)
- Database learning notes (sql04)
- Parallax JS special effect JS carousel map plug-in
猜你喜欢

H5 sunflower operation

CSDN salary increase technology selenium automated test stack summary

Digital collection, ten thousand words long text, most of the questions you want to know have been clearly explained, which must be seen by practitioners

数字经济专家高泽龙:映客更名映宇宙,元宇宙会成为映客下一个增长引擎吗?

论文阅读:Duplex Contextual Relation Network for Polyp Segmentation

Bayesian inference problem, MCMC and variational inference

bluecmsv1.6代码审计

On the first anniversary of the data security law, which four major changes are coming?

如何通过W3school学习JS/如何使用W3school的JS参考手册

easypoi
随机推荐
类加载机制与对象的创建
数论 --- 欧拉函数、筛法求欧拉函数、欧拉定理、费马小定理详细证明
Huawei cloud onemeeting tells you that the whole scene meeting is held like this!
电子科大(申恒涛团队)&京东AI(梅涛团队)提出用于视频问答的结构化双流注意网络,性能SOTA!优于基于双视频表示的方法!...
Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
判断字符串是否为空
Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
Bayesian inference problem, MCMC and variational inference
MDM data analysis function description
two thousand three hundred and forty-two
Design of secsha system
2022年P气瓶充装考试练习题及在线模拟考试
Bayesian inference problem, MCMC and variational inference
Severity code description project file line suppress status error lnk2038 detected a mismatch of "runtimelibrary": the value "md\u dynamicrelease" does not match the value "mdd\u dynamicde"
Tcwind mode setting
Leetcode week 299
2022年T电梯修理考试题库模拟考试平台操作
Pyinstaller打包pikepdf失败的问题排查
How strong a mathematical foundation does deep learning need?
裁员真能拯救中国互联网?