Skip to content
Advertisement

aws cli describe cluster error using ‘for loop’

I’m having trouble trying to run a for loop with the aws cli command aws eks describe-cluster. I receive the below error on execution. My scripting is not the best. Any help would be greatly appreciated. Thanks.

JavaScript

If I simply run aws eks list-clusters | grep dev-shark it outputs the below:

JavaScript

It seems to be the comma (,) that is causing the error? How best to remove the , at the end of each line?

Advertisement

Answer

It is both the comma (,) and the quotation mark (“) that are causing the error. Instead of doing

JavaScript

, you can do

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement