I am not able to capture errors while I am using dialog. For example:
dialog --gauge "Verifying file..." 10 75 < <(
while read LINE
do
hash=$(echo $LINE | cut -f1 -d' ')
directory=$(echo $LINE | cut -c 34-)
PCT=$(( 100*(++i)/n ))
echo $PCT
md5deep -a $hash $directory > /dev/null
RESULT=$?
if [ $RESULT -ne 0 ]
then
dialog_hash_failed
error "Failed"
fi
done < $TAR_SO/$SOURCEFILE_NAME.md5
)||exit 1
However, if I get rid of the dialog command, I am able to capture all errors in the md5 verification. While using dialog, the code exits successfully but the return value is always a zero. I am expecting a non zero return value and I am able to achieve it while not using dialog