This is frustrating. I want to create a new persistent and system-wide environment variable via a shell script on OSX (El Capitan)
The export -command only works for the current session (so it’s needed internally by the script but doesn’t write anything that is persistent on the system)
…and then what?
Googling this I find:
-People talking about appending the path to .bash_profile, manually… I find nothing about appending to this file via shell script
-People saying .bash_profile only applies to shells (so say, any apps that need to know my custom environment variable will still be clueless)
-People talking about appending the path to enrivonment.plist (turns out this is for older versions of OSX - the file is no longer used)
Add to the confusion that people fail to provide info on what shell they are using when providing code examples.