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

边栏推荐
- Configuration du mode tcwind
- The severity code indicates that the project file line prohibits the display of status errors. C1047 object or library file ".Lib" is different from other objects (such as "x64\release\main.obj")
- 2022年T电梯修理考试题库模拟考试平台操作
- 100人成绩的平均
- 数字经济专家高泽龙:映客更名映宇宙,元宇宙会成为映客下一个增长引擎吗?
- Autumn recruitment experience sharing | how to prepare for bank interview
- 颜色渐变的FontAwesome图标
- Variational graph auto-encoders (VGAE)
- R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题
- Time series forecasting based on trend and seasonality
猜你喜欢

Time series forecasting based on trend and seasonality
![[324. swing sequence II]](/img/4f/dbbc28c7c13ff94bd0956f2ccf9603.png)
[324. swing sequence II]

Analysis of all knowledge points of TCP protocol in network planning

Windows 64 bit download install my SQL

Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"

How does redis implement inventory deduction? How to prevent oversold?

How does win11 slim down the system disk? Slimming method of win11 system disk

28 rounds of interviews with 10 companies in two and a half years

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

R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions
随机推荐
2342
2280.Cupboards
2280.Cupboards
TcWind 模式设定
Demo of integrated development of intelligent computing system 3 plugin
Internship: term understanding and handwriting interface
计网 | 一文解析TCP协议所有知识点
如何通过W3school学习JS/如何使用W3school的JS参考手册
Rsync remote synchronization
From design delivery to development, it is easy and efficient!
April 10, 2022 -- take the first step with C -- use C from Net class library call method (not understood)
30讲 线性代数 第四讲 线性方程组
Design of secsha system
2788.Cifera
Kaggle肠胃道图像分割比赛baseline
Pyinstaller打包pikepdf失败的问题排查
List adding timer (positive and countdown)
How to learn JS through w3school / how to use the JS reference manual of w3school
压缩与解压缩命令
论文阅读:Duplex Contextual Relation Network for Polyp Segmentation