Continuing
サブシェルを削除すると、以下のコードが出力されます。サブシェルでは、テスト後に別の成功した呼び出しが必要です (:
成功した no-op コマンドを使用するのが最も簡単です、IMO) Continuing
。
#!/bin/sh
set -e #Exit on untested error
( #Subshell
#Some succesfful commands go here
#And here comes a file test
[ -f "doesntExist" ] && {
: #Irrelevant
}
#:
)
echo Continuing
この動作は正しいですか? サブシェルを導入すると動作が変わるのはなぜですか
[ -f "doesntExist" ] && {
:
}
私はdash 0.5.7-2ubuntu2
これを実行するために使用しています。