fishを使い始めたのですが、シェルスクリプトを書くときに文法が違うんですね。 すぐ慣れると思いますが、私が最初につまずいた部分をまとめました。 ANDとOR fishでは、&&、||の代わりに、「; and」「; or」を使います。 【AND】 bashの場合: command1 && command2 fishの場合: command1; and command2 【OR】 bashの場合: command1 || command2 fishの場合: command1; or command2 大文字、小文字は区別しないので、 command1; AND command2 command1; OR command2 とも書けます。 シェル変数 変数に値をセットするのは「set」を使います。 bashの場合: FOO="bar" fishの場合: set FOO "bar" 変数を削除す
![fishとbash、シェルスクリプトを書くときの違いメモ](https://cdn-ak-scissors.b.st-hatena.com/image/square/c980a972fc63823eddf8fe63a8f3aa6902bff3d8/height=288;version=1;width=512/https%3A%2F%2Foversleptabit.com%2Fwp-content%2Fuploads%2F2018%2F10%2FTerminal_Logo_CRT_Small.png)