I'm having problems persistently setting environment variables in a bash script. Here's an example of the script :
cat > /etc/environment << EOF
The problem is these variables become accessible to to the script that runs but once the script is complete they aren't accessible to the shell. Please note that this script is running as user-data on my Amazon EC2 server so I have no control over how the script is launched.
Is there a way to source these variables so I can then access them from the shell? Also please note my original script places a lot of variable in /etc/environment