I want to have a simple way to enter messages for employees to see upon logging in. It doesn't have to be date specific, although that would be nice, but I can't find a way to use dialog to allow me to enter multiple lines of text before I cat to the file.
Little help?
#!/bin/sh
DIALOG=${DIALOG=dialog}
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
$DIALOG --title "Bulletin Board Entry" --clear \
--inputbox "Enter Today's Very Important\n
employee information below:" 16 51 2> $tempfile
retval=$?
case $retval in
0)
echo "Input string is `cat $tempfile`";;
1)
echo "Cancel pressed.";;
255)
if test -s $tempfile ; then
cat $tempfile
else
echo "ESC pressed."
fi
;;
esac