【zsh】ラズパイに入れてみた

この前、雑談でちょっと触れたzsh…。とりあえず、こいつをRaspberry Piに入れて遊んで見ようと思います。何もわかってないので、インストールとちょっとだけ触って・・・後は少しずつ加筆出来たらなって思っています。ちなみに、昨日の右折の交差点を今日も通ったのですが、並んだ時の先頭のやつがモタツキやがって・・・携帯でも見てたんでしょうか・・・更に曲がれる車が少なくなるという残念な結果に・・・

兎にも角にもインストール

先ずはzshのイントールをします。

$ sudo aptitude update
$ sudo aptitude install zsh

こんな感じに聞かれますので「Y」でインストールしましょう。

The following NEW packages will be installed:
  zsh zsh-common{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 4550 kB of archives. After unpacking 16.8 MB will be used.
Do you want to continue? [Y/n/?]

プロンプトが返ってきたらインストール完了です。whichで確認してみましょう。
binの下にインストールされていると思います。

$ which zsh
/usr/bin/zsh

zsh起動

まずはちょっと触ってみましょうか。流石に起動シェルをいきなり替えたりしません。
以下を打ちましょう。

$ zsh

なんか聞かれました。

This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~).  This function can help you with a few settings that should
make your use of the shell easier.

You can:

(q)  Quit and do nothing.  The function will be run again next time.

(0)  Exit, creating the file ~/.zshrc containing just a comment.
     That will prevent this function being run again.

(1)  Continue to the main menu.

(2)  Populate your ~/.zshrc with the configuration recommended
     by the system administrator and exit (you will need to edit
     the file by hand, if so desired).

--- Type one of the keys in parentheses ---

とりあえず、前に進んでみましょう。「1」を入力
「q」は何もせず終了
「0」はコメントのみの「.zshrc」ファイルを作って終了
「1」はメインメニューへ
「2」はシスアド用のおすすめ「.zshrc」を作って終了
って感じでしょうか・・・
また聞かれました。

Please pick one of the following options:

(1)  Configure settings for history, i.e. command lines remembered
     and saved by the shell.  (Recommended.)

(2)  Configure the new completion system.  (Recommended.)

(3)  Configure how keys behave when editing command lines.  (Recommended.)

(4)  Pick some of the more common shell options.  These are simple "on"
     or "off" switches controlling the shell's features.  

(0)  Exit, creating a blank ~/.zshrc file.

(a)  Abort all settings and start from scratch.  Note this will overwrite
     any settings from zsh-newuser-install already in the startup file.
     It will not alter any of your other settings, however.

(q)  Quit and do nothing else.  The function will be run again next time.
--- Type one of the keys in parentheses --- 

今回は素の状態から触ってみたいので、「0」を選択しようと思います。
以下のようなメッセージが表示されzshが起動しました。

The function will not be run in future, but you can run
it yourself as follows:
  autoload -Uz zsh-newuser-install
  zsh-newuser-install -f

The code added to ~/.zshrc is marked by the lines
# Lines configured by zsh-newuser-install
# End of lines configured by zsh-newuser-install
You should not edit anything between these lines if you intend to
run zsh-newuser-install again.  You may, however, edit any other part
of the file.
% 

今日はここまで

.zshrcを覗いてみましょう

cat .zshrc
# Created by newuser for 5.7.1

作られてますね。次回からこのファイルを弄って遊んでみたいと思います。

関連記事

Swift4におけるsubstringについて

【Ubuntu】Ubuntu18.04LTSにアップグレードしてやったことメモ

【Ubuntu】UnuntuにSwiftをインストールしてみた件

【Ubuntu】Ubuntuを18.04LTSにアップグレードしてみた

【Xcode】Firebaseを組み込んだ矢先にハマった事(その2)

【Swift4】「'characters' is deprecated」というワ...