Help us understand the problem. What is going on with this article?

bashからzshへの乗り換え

:pencil: このエントリーは、MacOS Catalinaからデフォルトシェルが bash から zsh になったことを期に、bashからzshへ乗り換えるための作業メモ

前提条件

ホームディレクトリで作業

$ pwd
/Users/gentamura

現在利用しているシェルはbash

$ echo $SHELL
/bin/bash

zshがインストールされている

❯ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

移行作業

ログインシェルを入れ替え

$ chsh -s /bin/zsh

一旦ターミナルを閉じて、再起動

利用しているシェルを確認

$ echo $SHELL
/bin/bash

設定ファイルをコピー

$ cp .bash_profile .zsh_profile

設定ファイルを一部書き換え

$ vim .zsh_profile
.zsh_profile
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"

export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/Applications/flutter/bin:$PATH"

export GOPATH="$(go env GOPATH)"
export PATH="$GOPATH/bin:$PATH"

eval "$(starship init bash)" => eval "$(starship init zsh)" に変更

再起動

$ source .zsh_profile

以上です。
今の所無事動いているので、なにかあれば追記します:elephant:


追記
ターミナル再起動したところ、 starship が適用されなかったので、以下を追加

.zshrc
source ~/.zsh_profile
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした