当前位置:网站首页>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.

边栏推荐
- Ali open source (easyexcel)
- 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
- Quaternion quaternion and Euler angle Transformation in Ros
- 2280.Cupboards
- Kaggle肠胃道图像分割比赛baseline
- 2022年P气瓶充装考试练习题及在线模拟考试
- The white paper on the panorama of the digital economy and the digitalization of consumer finance were released
- 集合之ArrayList
- From design delivery to development, it is easy and efficient!
- Tcwind mode setting
猜你喜欢

echart:横向柱状图的类目文字位置调整

变分自编码器 (Variational Autoencoders, VAEs)

easypoi

Rsync remote synchronization

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

Analysis of all knowledge points of TCP protocol in network planning

【Go语言刷题篇】Go从0到入门5:Map综合复习、条件语句、循环语句练习

Ali open source (easyexcel)

还在付费下论文吗?快来跟我一起白piao知网

Bayesian Reference problem, mCMC and variational reference
随机推荐
管道 | 与重定向 >
视差js特效js轮播图插件
Head, tail view file
Bayesian Reference problem, mCMC and variational reference
2788.Cifera
阿里开源(EasyExcel)
2022年P气瓶充装考试练习题及在线模拟考试
Industry analysis - quick intercom, building intercom
return new int[]{i + 1, mid + 1}; return {i + 1, mid + 1};
Parallax JS special effect JS carousel map plug-in
Kaggle腸胃道圖像分割比賽baseline
2788.Cifera
F (x) construct the equation, calculate the partial derivative by gradient descent, determine the partial derivative adjustment by loss function, and deal with nonlinear problems by activation functio
Configuration du mode tcwind
Demo of intelligent computing system 2 bangc operator development (heterogeneous programming flow of CPU and mlu270)
Database learning notes (sql04)
100人成绩的平均
Demo of integrated development of intelligent computing system 3 plugin
Grep text search tool
Windows 64 bit download install my SQL