0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

あれ?.bash_profileや.bashrcが効いてないな?って思った時に読む記事

Last updated at Posted at 2019-12-15

Macのバージョンアップに伴い、bashからzsh切り替わるとターミナルの$が、%になるんやけどここで気づいて欲しいのは僕らの「~/.bash_profile」はどうなったんやということ
bashからzshに移行メモにあるようにシンプルにとりあえず丸コピーでいいわっていう人はこれ

bash
$ cat .bash_profile >> .zprofile

なんやったら。あの上書きされると困る人もいるので一応追記コマンドにしてます

bash
$ cat .bashrc >> .zshrc

余談

あと余談なんやけどpyenvを入れた後に上記作業もやってると色々面倒で以下のようなことが起きてた
python2>3自動切り替えされんなんや分からんとりま「pyenv init」や

zsh
 ~ % pyenv init
# Load pyenv automatically by appending
# the following to ~/.zshrc:

eval "$(pyenv init -)"

親切に「~/.zshrcに追加しろ!」って教えてくれるんですね。
なので、cat使って一行で追加すると

echo "eval \"\$(pyenv init -)\""  >> .zshrc

前提環境:zsh

蛇足

あれお前profileに追記してないやんけという人はこちら
本当に正しい .bashrc と .bash_profile の使ひ分け

いまさらですがzshって2013年には切り替えよっていわれてたんですね

コマンド - とりあえずZshを使えば良いんだろう? - Qiita

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?