if文ワンライナー
[ ${PIPESTATUS[0]} == 0 ] のように記載する
$ sh -c 'true | tee && [ ${PIPESTATUS[0]} == 0 ]'; echo $?
bashの結果の比較
[[ $? == 0 ]]
元
if [ -f ${target} ]; then echo 'true' ;fi
This post is licensed under CC BY 4.0 by the author.
[ ${PIPESTATUS[0]} == 0 ] のように記載する
$ sh -c 'true | tee && [ ${PIPESTATUS[0]} == 0 ]'; echo $?
[[ $? == 0 ]]
if [ -f ${target} ]; then echo 'true' ;fi