Skip to content

Instantly share code, notes, and snippets.

@bugcy013
Forked from tariqmislam/global env vars for root
Created September 6, 2013 19:08
Show Gist options
  • Select an option

  • Save bugcy013/6468477 to your computer and use it in GitHub Desktop.

Select an option

Save bugcy013/6468477 to your computer and use it in GitHub Desktop.
I ran into a situation where I needed to execute something as root, but the executable file needed access to environment variables that I had defined in my .bashrc file.
To fix this, I added those same environment variable definitions from the .bashrc file to my /etc/environment file. Note that you need to remove the 'export' statement at the beginning of each variable you define in /etc/environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment