Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

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


case $retval in
    echo "Input string is `cat $tempfile`";;
    echo "Cancel pressed.";;
    if test -s $tempfile ; then
  cat $tempfile
  echo "ESC pressed."
share|improve this question

Use --editbox emptyfile instead of --inputbox. Unfortunately this won't allow you to pass /dev/null instead of emptyfile, so you'll actually have to create an empty (temporary) file. Or a file containing a message template.

share|improve this answer
I'm on redhat RHEL5 and I don't have editbox available. Any workaround? – Robby Glasco Jul 18 '12 at 15:17
You could grab the latest sources from the dialog homepage, compile them yourself and call them by explicit path for this invocation. Unless you want to install this latest version system-wide. – MvG Jul 18 '12 at 15:24

As an alternative to dialog, you could simply fire up an editor with the temporary file. That way, every user might even be able to use his or her preferred $EDITOR, instead of the feature-limited dialog. Many applications do this kind of thing when they want user input. Version control systems in particular come to my mind here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.