How to add your knowledge

Setting environment variables on Mac OS X

    Table of contents
    No headers

    There are two ways you can set and unset Alias environment variables on Mac OS X:

    • Specify environment variables individually before each session in a bash shell using the commands export VARIABLENAME=value and unset VARIABLENAME.

      However, these variables will only be available if you run Alias from the shell. If you run Alias from the Dock or Finder, it will not use any of the environment variables from your shell.

    • Specify them in an environment.plist file that must be located in the .MacOSX directory at the root of your user home directory.

      ~/.MacOSX/environment.plist

      Example environment.plist file

      <?xml version="1.0" encoding="UTF-8"?> 
      <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
      "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
      <plist version="1.0"> 
      <dict> 
      	<key>ALIAS_HIDDEN_CASTS_SHADOWS</key> 
      	<string>ON</string> 
      </dict> </plist>
      

    To see the values of all your environment variables, use the printenv command in a shell.