コマンドシェルZshの導入

はじめに

この記事では以下に記載する環境にZshを導入する方法を取りあげる。なお、ZshについてはTHE Z SHELLWikipediaのZ Shellを参照のこと。

環境

  • Mac OS X Lion 10.7.3
  • Xcode 4.3.2 (llvm-gcc-4.2が使えればよい)
  • git 1.7.9.6

インストール対象

  • zsh 4.3.17-dev-0 (x86_64-apple-darwin11.3.0)

導入手順

1.Zshのレポジトリを入手

ZSH - Gitで配布しているレポジトリを使用する。コミット番号は19fe2dcc03d6f3c418e738061e46d0ae013c2550である。

1
$ cd ~/repository$ git clone git://zsh.git.sf.net/gitroot/zsh/zsh

2.Zshをコンパイル

1
$ cd ~/repository/zsh$ ./Util/preconfig$ ./configure --enable-multibyte$ make$ maek check$ make TESTSUM=C02 check$ make TESTSUM=Y check$ sudo make install

コンパイル完了後、/usr/local/binにzshを設置する。whichコマンドでパスが通っているか確認する。

1
$ which zsh

3.Zshをシェル一覧ファイルに登録

1
$ sudo vim /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/usr/local/bin/zsh

4.Zshを使用するシェルに指定

1
$ chsh -s /usr/local/bin/zsh