问题
I have a loop that gets all the ids and checks for the status of the jobs on cli.
jq -r '.JobList |= unique_by(.ArchiveId) | .JobList[] | "\(.JobId)"' jobs.json\
| while IFS= read -r job_id; do
job_status=$(aws glacier describe-job --account-id 2222222--vault-name my-vault --job-id $job_id --output json)
echo $job_status"," >> job-status.json
done
My issue here is that I get the following response everytime it goes past the job_status command
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
If i run this one by one I would get the result and it would append. But once I do a loop through, it would have empty values on the json file.
来源:https://stackoverflow.com/questions/60501032/looping-through-a-list-of-archive-id-with-cli-aws-describe-job-returns-null-on-o