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

边栏推荐
- Variational graph auto-encoders (VGAE)
- 还在付费下论文吗?快来跟我一起白piao知网
- Class loading mechanism and object creation
- 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C1047 对象或库文件“.lib”是使用与其他对象(如“x64\Release\main.obj”)不同的
- 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
- H5 sunflower operation
- Tcwind mode setting
- How does win11 slim down the system disk? Slimming method of win11 system disk
- 微信小程序_8,视图与逻辑
- 核芯物联蓝牙aoa定位系统服务器配置估算
猜你喜欢

R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题

Xiaobai's e-commerce business is very important to choose the right mall system!

Double contextual relationship network for polyp segmentation

easypoi

Nanopc-t4 (rk3399) Game1 OLED (I2C) display time weather temperature

Number theory -- detailed proof of Euler function, sieve method for Euler function, Euler theorem and Fermat theorem

C#应用程序界面开发基础——窗体控制

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

Rsync remote synchronization

Gaozelong, a digital economy expert: Yingke changed its name to yingcosmos. Will yuancosmos become the next growth engine of Yingke?
随机推荐
Head, tail view file
h5向日葵作业
Echart: category text position adjustment of horizontal histogram
wc命令的使用
JVM memory structure
risc-v指令集
Pipeline | and redirection >
Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
Day88. qiniu cloud: upload house source pictures and user avatars
2022焊工(初级)特种作业证考试题库及答案
Number theory -- detailed proof of Euler function, sieve method for Euler function, Euler theorem and Fermat theorem
Class loading mechanism and object creation
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C1047 对象或库文件“.lib”是使用与其他对象(如“x64\Release\main.obj”)不同的
2022年T电梯修理考试题库模拟考试平台操作
I. The HR system is put on the enterprise wechat ISV to enhance the in-depth application of enterprise wechat in service chain retail and other industries
社招两年半10个公司28轮面试面经
Ali open source (easyexcel)
522. 最长特殊序列 II(贪心&双指针)
On the first anniversary of the data security law, which four major changes are coming?
2837. The total number of teams