【发布时间】:2019-12-18 18:59:10
【问题描述】:
如何只返回 Pending 值?现在该命令返回整个 json 对象。
这是我目前得到的,但不知道如何过滤到 Pending 值
$DEPLOYMENT_ID // env variable
$(aws deploy get-deployment --deployment-id "$DEPLOYMENT_ID")
// returns:
{
"deploymentInfo": {
"applicationName": "WordPress_App",
"status": "Succeeded",
"deploymentOverview": {
"Failed": 0,
"InProgress": 0,
"Skipped": 0,
"Succeeded": 1,
"Pending": 0
},
...,
...,
}
}
我想像这样在 if else 块中运行命令:
if [[ $(aws deploy get-deployment --deployment-id "$DEPLOYMENT_ID") = 0 ]] ;
then
// do stuff
fi
【问题讨论】:
标签: linux bash shell unix terminal