xref: /freebsd/contrib/dialog/samples/report-string (revision a98ff317388a00b992f1bf8404dee596f9383f5e)
1#!/bin/sh
2# $Id: report-string,v 1.3 2012/06/29 09:32:17 tom Exp $
3# Report result passed in a string $RESULT
4# vile:shmode
5
6case $retval in
7  $DIALOG_OK)
8    echo "Result is $RESULT";;
9  $DIALOG_CANCEL)
10    echo "Cancel pressed.";;
11  $DIALOG_HELP)
12    echo "Help pressed ($RESULT).";;
13  $DIALOG_EXTRA)
14    echo "Extra button pressed.";;
15  $DIALOG_ITEM_HELP)
16    echo "Item-help button pressed.";;
17  $DIALOG_ESC)
18    if test -n "$RESULT" ; then
19      echo "$RESULT"
20    else
21      echo "ESC pressed."
22    fi
23    ;;
24esac
25