0

What is the best way to modify or create environment variables from a script in a way that is cross distro/*nix friendly? I simply want to add a couple of environment variables via a bootstrap script, but there are so many places to do this and, for example, ubuntu prefers /etc/environment but I don't want to write a lot of logic to deal with different distros and I would like to support OS X. Is there a best-practices way to do this?

user445994
  • 229
  • 3
  • 10

1 Answers1

0

For the Mac OS X bit, this question appears to have discussed it to good depth. And, this question appears to have a decent discussion for global environment variables on Linux.

I see a /etc/environment but it is empty, on Debian system. I think global initialization files are defined per shell, if a shell has such a file.

Community
  • 1
  • 1
vpit3833
  • 7,817
  • 2
  • 25
  • 25