/contrib/dialog/samples/gauge2

https://bitbucket.org/freebsd/freebsd-head/ · Shell · 28 lines · 18 code · 6 blank · 4 comment · 1 complexity · 8928c1b01e3cd5bda9e0d7de2512225d MD5 · raw file

  1. #!/bin/sh
  2. # $Id: gauge2,v 1.8 2010/01/13 10:26:52 tom Exp $
  3. # The original dialog program assumed the first line after the first "XXX"
  4. # was a percentage value (compare with "gauge" script).
  5. . ./setup-vars
  6. (echo "10" ; sleep 2 ;
  7. cat <<"EOF"
  8. XXX
  9. The new
  10. \n
  11. message
  12. XXX
  13. 20
  14. EOF
  15. sleep 2;
  16. echo "75" ; sleep 1
  17. echo "100") | \
  18. $DIALOG --title "GAUGE" "$@" --gauge "Hi, this is a gauge widget" 10 40 0
  19. if [ "$?" = $DIALOG_ESC ] ; then
  20. echo ""
  21. echo "Box closed !"
  22. fi