魚の殻の状態

魚の殻の状態

Fish Shellチュートリアルを探索している間、この単純なif-elseブロックが機能しないことがわかりました。

if grep fish /etc/shells
            echo Found fish
else if grep bash /etc/shells
            echo Found bash
else
            echo Got nothing
end

エラーメッセージ:

/usr/bin/fish
Found fish
fish: global root block
fish: Could not locate end of block. The 'end' command is missing, misspelled or
a ';' is missing.

       end - end a block of commands.

ベストアンサー1

おそらく、else-if設定よりも古いバージョンの非常に古い(1.x)バージョンのフィッシュがインストールされている可能性があります。出力は何ですかfish --version?理想的には2.1.0が欲しいです。

おすすめ記事