bash compare variable and variable + string
This question already has an answer here:
I have no AWS CLI stuff, so here is example with stubs:
task_name () {
echo "$task"
}
state () {
echo "$task RUNNING"
}
task_status () {
tasksInCluster=(mis-dev-core mis-dev-other "mis-dev with space")
for task in "${tasksInCluster[@]}"; do
if [ "$(state)" != "$(task_name) RUNNING" ]
then
echo "$(task_name)" "NOT RUNNING!"
exit 1
else
state
fi
done
}
task_status
UPDATE: As noted @charles-duffy, use array instead string.
链接地址: http://www.djcxy.com/p/29138.html上一篇: 将bash中的多个参数传递给python
下一篇: bash比较变量和变量+字符串