shellでファイルの存在を判定する
fish
test (fish)を使う
$ test -f file
from test: ファイル・文字列・数値に対するテストを行う
bash
$ if -x ./test ; then
[]はtest (bash)の略
もしかしてtest (fish)と同じ機能?
他にもif -e, if -fなど色々ある
from bashでファイルやディレクトリの存在確認方法まとめ - Qiita
#2020-12-27