I have a bash script which sets environment variables and then creates another (child?) bash process in which those variables are set.
I'd like to execute a command inside that new bash script, which is within the scope of the newly created environment variables. I know that I can call bash and pass in another existing .sh file, however I need to pass in a string which can be dynamically generated.
Is this possible?
#!/bin/bash
# ....
export AWS_ACCESS_KEY_ID=$AccessKeyId
export AWS_SECRET_ACCESS_KEY=$SecretAcessKey
# ...
# This line fails
bash <$(echo "aws sts get-caller-identity")
Thanks very much.