I've created a simple menu dialog, but the cancel button and escape key are returning 0 for the exit code. What am I doing wrong here?
exec 3>&1;
selection=$(dialog \
--title "Main Menu" \
--backtitle "$BACK_TITLE" \
--menu "Choose an option to configure. Up and down arrows change selection. Use the Enter key to make a selection." "$HEIGHT" "$WIDTH" 5 \
0 "Select Directory" \
1 "Select File Extension" \
2 "Options" \
3 "Execute with current config" \
4 "Exit" \
2>&1 1>&3);
exec 3>&-;
exitStatus=$?
echo "selected: $selection exit code: $exitStatus"
the above produces when I hit the escape key or the cancel button.
selected: exit code: 0