.profile или .bash_profile

Я смущен, где я устанавливаю переменные окружения?

В .profile или в .bash_profile?

Я использую и Mac OSX и человечность.

Перепутанный, относительно которого я использую здесь.

14
задан 02.08.2010, 20:06

2 ответа

чтение http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files:

 When Bash is invoked as an interactive login shell, or as a 
 non-interactive shell with the --login option, it first reads 
 and executes commands from the file /etc/profile, if that file
 exists. After reading that file, it looks for ~/.bash_profile, 
 ~/.bash_login, and ~/.profile, in that order, and reads and executes
 commands from the first one that exists and is readable. The 
 --noprofile option may be used when the shell is started to inhibit
 this behavior.

другая загрузка оболочек ~/.profile также (zsh, tcsh).. таким образом я поместил бы материал среды в ~/.profile.

связанное с Mac OSX обновление (благодарит @Matt B):

поскольку gui программы читают http://developer.apple.com/library/mac/#qa/qa2001/qa1067.html и редактирование ~/.MacOSX/environment.plist тщательно.

21
ответ дан 07.12.2019, 11:16

Если Вы используете удар, в ~/.bash_profile. Если Вы используете другие оболочки, в ~/.profile

4
ответ дан 07.12.2019, 11:16

Теги

Похожие вопросы