I set a variable that contains multiple values. (this is what I get from heroku config --shell, redacted)
The command to save command output was
envvars=`heroku config --shell -a heroku-app`
And echo "$envvars" result is like this:
BH_SERVER=000000000000000000
DATABASE_URL='postgres://stringno1:[email protected]:5432/randomstring2'
DISCORD_TOKEN=some.veryveryveryvery.long.token.string
EXM_SERVER=000000000000000001
MUTED_SERVER='000000000000000002, 000000000000000003'
SUPER_USER='000000000000000004, 000000000000000005'
TEST_SERVER=000000000000000006
TZ=Asia/Seoul
Now I want to set these values to environment variables. These must not be permanant because these are only needed by python app which will be executed later in script. I think I can use = as delimiter for distinguish key and value but not 100% sure about that. (I don't know how heroku convar works well)
I expect these-like output.
echo $BH_SERVER
# 000000000000000000
echo $DATABASE_URL
# postgres://stringno1:[email protected]:5432/randomstring2
# Note that there is no ' in start and end of line
echo $DISCORD_TOKEN
# some.veryveryveryvery.long.token.string
# Note that . is still there.
echo $MUTED_SERVER
# 000000000000000002, 000000000000000003
# Even if there is space in string, it should be treated as one line
# Also, there is no ' in start and end of line
echo $TZ
# Asia/Seoul
# / is not interpreted. I think this is normal.
There are some already-answered question but I don't find any answer that match my condition.
I put git-bash tag because I am working on Git Bash but I think solution of this question would be same as Bash.
eval $envvar? that just stops script working. I think it is waiting user input but not sure.