The trick is to use --output tsv
in combination with --query
then you don't need grep
and cut
as suggested by https://stackoverflow.com/a/55485500/1080523
Example:
> az account list --query '[].state' --output tsv
Enabled
Enabled
Enabled
Enabled
Enabled