シェルの初期化を行うためのスクリプトを整理したものです。
元ネタは http://www.linux.or.jp/JF/JFdocs/Path-6.html です。*1

 
 

shellの形態 †

  1. UNIXのユーザプロセス
    • /etc/passwd で指定されている shell の子プロセス
  2. UNIXのユーザプロセスの初期化
    • shellによって決められたshell scriptが起動して、パスの初期化や初期化プログラムの起動が行われる。
  3. shellの種類
    • login shell or non-login shell
      login shellとは、login時に呼ばれるshell。login shellは、-を前置きされて起動される(bashなら-bashとして起動される)。
       
       
    • interactive shell or non-interactive shell
      interactive shellとは、ユーザインタフェースとしてのシェル。
      non-interactive shellとは、ファイルやttyからのコマンド。

sh †

実行
順序
Shell Scriptscriptが実行されるshellの形態備考
loginnon-
login
interactivenon-
interactive
rsh
1/etc/profile○×−−×
2~/.profile○○○○○/bin/shが/bin/bashのシンボリックリンクでもこちらが実行される
凡例 [○:実行される ×:実行されない −:関係なし]

bash †

実行
順序
Shell Scriptscriptが実行されるshellの形態備考
loginnon-
login
interactivenon-
interactive
rsh
1/etc/profile○×−−×
2*~/.bash_profile○○○○○
2*~/.bash_login×○−−−~/bash_profileがある時実行されない
凡例 [○:実行される ×:実行されない −:関係なし]

結局 ~/.bash_profile の中から ~/.profile を呼ぶのが無難ですかなぁ・・・

tcsh †

実行
順序
Shell Scriptscriptが実行されるshellの形態備考
loginnon-
login
interactivenon-
interactive
rsh
1/etc/csh.cshrc−−×○−
2/etc/csh.login○×−−×主にpathをセットするのに使われる
3*~/.tcshrc−−×○−
3*~/.cshrc−−×○−~/.tcshrcがある時実行されない
4~/.history○○○○○
5~/.login○×−−×主にpathをセットするのに使われる
6~/.cshdirs○○○○○
凡例 [○:実行される ×:実行されない −:関係なし]

Computer


*1 情報の提供ありがとうございます。元ネタの配布条件がGPLなのでこの文書もGPLの配布条件に従います。

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2006-02-16 (木) 23:03:11 (7581d)
Short-URL: https://pukiwiki.at-sushi.com/pukiwiki/?cmd=s&k=5c87f3f2c4
ISBN10
ISBN13
9784061426061