linux - How to take json file output by bash as input
怪我咯
怪我咯 2017-06-19 09:07:30

Script novice, new to bash and zsh, now need to write a script to handle many test accounts in linux.

After using the command aws get-role...., the output in cmd displays a json text, and then I plan to use jq to parse it based on the key Out one of the values, but because of the huge number of accounts being processed, the json text corresponding to these accounts cannot be stored in file form for processing. Is there any way?

The approximate logic is as follows:
The ultimate goal is to get the value of name
name=$(cat (aws get-role....) | jq .Role.Name)But I If I write like this, the system will prompt mezsh: number expected

Is there something wrong with my brackets? Ask God for answers.
If the bracket problem is solved, is this way of writing too long and not beautiful? I am also asking for some guidance from the master, I am very grateful.

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
Popular topics
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!