shell
make all | tee log.txt;
if [[ "${PIPESTATUS[0]}" == 1 ]] || [[ "$pipestatus[1]" == 1 ]]; then
echo ng;
else
echo ok;
fi;
$pipestatus[1]
は zsh の場合
${PIPESTATUS[0]}
は bash の場合
More than 5 years have passed since last update.
make all | tee log.txt;
if [[ "${PIPESTATUS[0]}" == 1 ]] || [[ "$pipestatus[1]" == 1 ]]; then
echo ng;
else
echo ok;
fi;
$pipestatus[1]
は zsh の場合
${PIPESTATUS[0]}
は bash の場合
Register as a new user and use Qiita more conveniently