#! /bin/sh
# $Id: checklist9,v 1.1 2004/03/13 19:25:43 tom Exp $
# "checklist8" using --file
: ${DIALOG=dialog}

tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15

$DIALOG --file checklist9.txt 2>$tempfile

retval=$?

choice=`cat $tempfile`
case $retval in
  0|2)
    echo "'$choice' chosen.";;
  1)
    echo "Cancel pressed.";;
  255)
    echo "ESC pressed.";;
  *)
    echo "Unexpected code $retval";;
esac
