setenv variable with spaces in launchd.conf?

前端 未结 5 929
栀梦
栀梦 2021-01-02 07:58

I\'m a Linux user that just recently got a mac. I\'m trying to set up my IDE and found out that Macs don\'t use .bashrc / .bash_profile / etc. for GUI apps. So, if you have

5条回答
  •  春和景丽
    2021-01-02 08:31

    Add the following line to /etc/launchd.conf (create if it doesn't exist)

    setenv MY_VARIABLE My\ value\ with\ spaces

    Note that this will only have an effect after rebooting.

    To use the new value without having to reboot, additionally run the command in the terminal

    launchctl setenv MY_VARIABLE My\ value\ with\ spaces
    as patrikha suggested.

    Note that this will only have an effect for applications started after running the command. Manipulating /etc/launchd.conf is still necessary to keep the change after rebooting.

提交回复
热议问题