HardenedBSD/contrib/dialog/samples/report-tempfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
660 B
Plaintext
Raw Normal View History

2012-10-21 20:18:09 +02:00
#!/bin/sh
# $Id: report-tempfile,v 1.9 2020/11/26 00:18:32 tom Exp $
2011-01-13 03:21:23 +01:00
# Report results in a temporary-file.
# vile:shmode
case "${returncode:-0}" in
2011-01-13 03:21:23 +01:00
$DIALOG_OK)
echo "Result: `cat "$tempfile"`";;
2011-01-13 03:21:23 +01:00
$DIALOG_CANCEL)
echo "Cancel pressed.";;
$DIALOG_HELP)
echo "Help pressed: `cat "$tempfile"`";;
2011-01-13 03:21:23 +01:00
$DIALOG_EXTRA)
echo "Extra button pressed.";;
$DIALOG_ITEM_HELP)
echo "Item-help button pressed: `cat "$tempfile"`";;
$DIALOG_TIMEOUT)
echo "Timeout expired.";;
2011-01-13 03:21:23 +01:00
$DIALOG_ESC)
if test -s "$tempfile" ; then
cat "$tempfile"
2011-01-13 03:21:23 +01:00
else
echo "ESC pressed."
fi
;;
*)
echo "Return code was $returncode";;
2011-01-13 03:21:23 +01:00
esac