Reputation: 153
i am running a python command per below in bash env, it runs fine :
python -c "from ami_management import cleanup; cleanup.main(['10', 'ctm'])"
But when i am passing variables :
amis_to_retain="10"
ami_prefix="ctm"
python -c "from ami_management import cleanup;cleanup.main([$amis_to_retain, $ami_prefix])"
then it fails. Somehow not able to figure out how to pass these variables with single quotes instead of double quotes.
Please suggest.
Upvotes: 0
Views: 34
Reputation: 9488
You need to put quotes inside quotes.
python -c "from ami_management import cleanup;cleanup.main(['$amis_to_retain', '$ami_prefix'])"
Upvotes: 1