Mac OS X Lion no longer recognizes environment.plist?

前端 未结 10 1220
挽巷
挽巷 2020-12-09 02:38

Just installed Lion today and my PATH env variable is no longer being set by ~/.MacOSX/environment.plist. Did something change? Can\'t seem to find any info on that or how t

10条回答
  •  一整个雨季
    2020-12-09 03:19

    I just got burned by something similar in Snow Leopard, and then figured out what the problem was.

    I was doing:

    $ cd
    $ defaults write .MacOSX/environment FOO bar
    

    ...but it turns out that this is different from doing (in my case):

    $ cd
    $ defaults write /Users/ljnelson/.MacOSX/environment FOO bar
    

    That is, the "path" (it's not really a path) to your domain must be the full file path to your $HOME/.MacOSX/environment.plist file (minus the .plist suffix). Anything else will write variables to a different domain (no idea where it got put), apparently.

    So, upshot: always do defaults write /full/path/to/your/.MacOSX/environment VARNAME value; don't use any shortcuts at all for the first argument to the write subcommand.

提交回复
热议问题