Hi,
I have a problem with an environment variable that I am passing into an exec session. The command has worked in the past but recently, I am unable to pass an environment variable that a called executable can see properly. If I run, podman exec -e VAR='bob' -it some_cont bash -c "env", the environment is printed out and includes the environment variable VAR='bob'.
But I can not run podman exec .... bash -c "echo $VAR" successfully, nor in my current situation am I able to run podman exec -e PASSWORD="$var_I_just_read" .... bash -c "mysql -uroot -p${PASSWORD}... ". Because the env variable PASSWORD is not present, the mysql command asks for a password. This was certainly working ok previously, but doesn't seem to function now.
I have tried a bunch of different permutations, including running the command with real variables instead of environment variables, and it works ok. Also, I am sure that I used to be able to run 'podman exec -e SOMEVAR='Bob' -it cont_name bash -c "echo $SOMEVAR" and get Bob output.
What am I doing wrong?
MTIA, James
--
James Stewart Miller Bsc(hons) Psych.