シェル初期化ファイル

シェル初期化ファイル

Linuxでは(通常)これらの初期化ファイルは.bashrc(bashはデフォルトのシェルです)で、OSXでは.bash_profileであることがわかります。しかし、zshのような他のシェルもあります。

そのため、bashをデフォルトのシェルにして、.bashrcで設定して実行することにした場合、exec zshzshのinitステップを具体的に指定するためにどのファイルを編集する必要がありますか?新しい端末を初期化するときに実行されるさまざまな種類のシェル用の別々のファイルはありますか?

同じ結果を得るために、.bashrcにいくつかのエイリアスを追加してみました。

alias switch_to_zsh="exec zsh; source zsh_config.sh"

しかし、zshに切り替えた後、source zsh_config.shいくつかを忘れていました。

ベストアンサー1

zshマニュアルから:

   Commands are then read from $ZDOTDIR/.zshenv.  If the shell is a  login
   shell,  commands  are  read  from  /etc/zsh/zprofile  and  then  $ZDOT‐
   DIR/.zprofile.  Then, if the shell is interactive,  commands  are  read
   from /etc/zsh/zshrc and then $ZDOTDIR/.zshrc.  Finally, if the shell is
   a login shell, /etc/zsh/zlogin and $ZDOTDIR/.zlogin are read.

おすすめ記事