For example do this command.
aws ecs list-tasks --cluster aic-prod
then it returns below
{
"taskArns": [
"arn:aws:ecs:ap-northeast-1:678100228133:task/aic-prod-cn/ae340032378f4155bd2d0eb4ee60b5c7"
]
}
then do next command using the ae340032378f4155bd2d0eb4ee60b5c7 of return sentence.
aws ecs execute-command --cluster aic-prod-cn --container AicDjangoContainer --interactive --command '/bin/bash' --task ae340032378f4155bd2d0eb4ee60b5c7
I want to do this thing in one sentence, or shell script. Is it possible?
I googled around the regular expression, but still unclear.
aws ecs list-tasks --cluster aic-prod | grep taskArns | (regular expression??)
Could you give some help?