 
 
 
 
 
   
 Next: 我想要知道更多各種 shell 的相異之處。請指點明路。
 Up: 關於各種 shell 的問題
 Previous: 要如何得知是否是在一 interactive shell 中?
     下面的說明或許不盡完整,但應該講的都講了。
- csh
- 
有一些版本在系統中所有使用者都必須讀取的 .cshrc 與 .login。不
過,每一個版本放置這些檔案的地方不大相同。
	- 
- 啟動 (依照所列順序):
	  
- .cshrc   - 每次都會讀取
- .login   - login shell 才會讀取
	  
 
 
- 結束之前:
	  
 
- 其他:
	  
- .history - 儲存history (根據 $savehist 的值決定大小).
	  
 
 
 - 
 
- tcsh
- 
- 
- 啟動 (依照所列順序):
	  
- /etc/csh.cshrc - 每次都會讀取
- /etc/csh.login - login shells 才會讀取
- .tcshrc        - 每次都會讀取
- .cshrc         - 假如沒有 .tcshrc 在的話
- .login         - login shells 才會讀取
	  
 
 
- 結束之前:
	  
- .logout        - login shells 才會讀取.
	  
 
 
- 其他:
	  
- .history       - saves the history (based on $savehist).
- .cshdirs       - saves the directory stack.
	  
 
 
 - 
 
- sh
- 
- 
- 啟動 (依照所列順序):
	  
- /etc/profile - login shell 才會讀取
- .profile     - login shell 才會讀取
	  
 
 
- 結束之前:
	  
- any command (or script) specified using the command:
                 trap "command" 0
	  
 
 
 - 
 
- ksh
- 
- 
- 啟動 (依照所列順序):
	  
- /etc/profile - login shells 才會讀取
- .profile     - login shells 才會讀取
- $ENV        - always, if it is set.
	  
 
 
- 結束之前:
	  
- 如果你用了 trap "command" 0,則結束之際會去執行 "command"。
	  
 
 
 - 
 
- bash
- 
- 
- 啟動 (依照所列順序):
	 
- /etc/profile  - login shell 才會讀取
- .bash_profile - login shell 才會讀取
- .profile      - 如果沒有 .bash_profile,則會在 login 時讀取
- .bashrc       - interactive non-login shell 才會讀取
- $ENV          - 若有設定則讀取之
	 
 
 
- 結束之前:
	 
- .bash_logout  - login shell 讀取之
	 
 
- 其他:
	 
- .inputrc      - Readline 初始化之時
	 
 
 
 
- zsh
- 
- 
- 啟動 (依照所列順序):
	
- .zshenv - 若無 -f  就會讀取
- .zprofile - login shell 才會讀取
- .zshrc    - interactive shell 若無 -f  就會讀取
- .zlogin   - login shell 結束之前
	
 
 
- 結束之前:
	
- .zlogout  - login shell 才會讀取
	
 
 
 
- rc
- 
 
 
 
 
 
 
   
 Next: 我想要知道更多各種 shell 的相異之處。請指點明路。
 Up: 關於各種 shell 的問題
 Previous: 要如何得知是否是在一 interactive shell 中?
Tan Koan-Sin
1999-03-02