I need to set a system environment variable from a bash script that would be available outside of the current scope. So you would normally export environment variables like
Set the variable in /etc/profile (create the file if needed). That will essentially make the variable available to every bash process.