recently on mac, i set an environment variable so that it is present in a new shell. today opening a shell it no longer appears in a new shell even when i set it. i have been using:
export "AVARIABLE=example" >>~/.bash_profile
which has worked fine until now when i run:
echo $AVARIABLE
i just get a blank line as if it doesn't exist.
this is happening any time i try to set an environment variable permanently now. i can't see what i'm doing wrong?
thanks in advance
You are missing an echo in your command. Try this and and then source the ~/.bash_profile:
echo export "AVARIABLE=example" >> ~/.bash_profile
You also have to source the .profile after you make changes to it.
source ~/.bash_profile
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With