Q:

Variable substition in bash command

I wanted to do variable substitution in the command below but I can't make it work. The command does not get the value of the variable (ORG and ORGADMIN). Any help is appreciated
ORG=caveman
ORGUPPERCASE=Caveman

KEY_FILE_NAME=$(kubectl exec ${ORG}-copy-pod -- bash -c 'ls /${ORG}-org-shared/users/${ORGUPPERCASE}OrgAdmin/msp/keystore')

A:

Expressions don't expand in single quotes, use double quotes for that.
KEY_FILE_NAME=$(kubectl exec ${ORG}-copy-pod -- bash -c "ls /${ORG}-org-shared/users/${ORGUPPERCASE}OrgAdmin/msp/keystore")

And you can always check your syntax @ shellcheck.net

