/contrib/dialog/samples/infobox5

https://bitbucket.org/freebsd/freebsd-head/ · Shell · 39 lines · 32 code · 3 blank · 4 comment · 0 complexity · 2fd06cb11ba1575bded161d57e4dadd6 MD5 · raw file

  1. #! /bin/sh
  2. # $Id: infobox5,v 1.7 2011/01/18 09:19:09 tom Exp $
  3. # get rid of all flickering by constructing a script unroll the loop, leaving
  4. # us in curses-mode until we're done counting.
  5. . ./setup-vars
  6. . ./setup-tempfile
  7. left=10
  8. unit="seconds"
  9. last='\'
  10. cat >>$tempfile <<EOF
  11. $DIALOG $last
  12. EOF
  13. while test $left != 0
  14. do
  15. cat >>$tempfile <<EOF
  16. --sleep 1 \
  17. --begin 0 5 \
  18. --title "INFO BOX" $* \
  19. --infobox "Hi, this is an information box. It is
  20. different from a message box: it will
  21. not pause waiting for input after displaying
  22. the message. The pause here is only introduced
  23. by the sleep command within dialog.
  24. You have $left $unit to read this..." 0 0 $last
  25. EOF
  26. left=`expr $left - 1`
  27. test $left = 1 && unit="second"
  28. done
  29. echo >>$tempfile
  30. . $tempfile