このセクションでは、コマンドラインの概要と開発者がそれを使用する理由を概説します。
また、コマンドライン内の大きなテーマについても言及し、関連するトピックにリンクする必要があります。コマンドラインのドキュメントは新しいものなので、関連トピックの初期バージョンを作成する必要があります。
Unix / Posixシステムの場合:
>$ echo "Hello World!"
この単純なコマンドは、端末上でHello Worldを出力します。
最も簡単な方法は、 brew
を使用brew
です。
brew install zsh
インストール後、次のようにしてデフォルトのシェルとして設定することができます。
sudo echo '/usr/local/bin/zsh' >> /etc/shells
chsh -s /usr/local/bin/zsh
gitがあり、必要なコマンドラインツールがインストールされている場合、次のように最新のバージョン(この編集時点では5.2
)をコンパイルしてインストールすることができます:
# clone the source
git clone git://git.code.sf.net/p/zsh/code zsh
# checkout the required version, say, zsh-5.2
cd zsh && git checkout zsh-5.2
# check the documentation for help on configuration options
./Util/preconfig
./configure --prefix=/usr/local \
--enable-fndir=/usr/local/share/zsh/functions \
--enable-scriptdir=/usr/local/share/zsh/scripts \
--enable-site-fndir=/usr/local/share/zsh/site-functions \
--enable-site-scriptdir=/usr/local/share/zsh/site-scripts \
--enable-runhelpdir=/usr/local/share/zsh/help \
--enable-etcdir=/etc \
--mandir=/usr/local/share/man \
--infodir=/usr/local/share/info \
--enable-cap \
--enable-maildir-support \
--enable-multibyte \
--enable-pcre \
--enable-zsh-secure-free \
--with-tcsetpgrp
# compile and check if compiled successfully
make -j5 && make check
# you should see results of successful test scripts
sudo make install
ここでも、 zsh
を/etc/shells
追加し、上記のようにchsh
を使用することで、デフォルトのシェルとしてzsh
を作成することができます。
brew install zsh
sudo echo '/usr/local/bin/zsh' >> /etc/shells
chsh -s /usr/local/bin/zsh