태그 보관물: mac

mac

.profile 또는 .bash_profile 또는 .bash_profile에서? Mac OSX와

환경 변수를 어디에 설정해야합니까?

.profile 또는 .bash_profile에서?

Mac OSX와 우분투를 모두 사용하고 있습니다.

내가 어느 것을 사용하는지 혼란 스럽습니다.



답변

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입니다.

맥 OSX 관련 업데이트 (@Matt B 덕분에) :

GUI 프로그램의 경우 http://developer.apple.com/library/mac/#qa/qa2001/qa1067.html을 읽고 ~/.MacOSX/environment.plist신중하게 편집 하십시오 .


답변

당신이, 떠들썩한 파티를 사용하는 경우 ~/.bash_profile. 다른 쉘을 사용하는 경우~/.profile


답변