/contrib/dialog/samples/gauge0-input-fd

https://bitbucket.org/freebsd/freebsd-head/ · Shell · 27 lines · 20 code · 4 blank · 3 comment · 2 complexity · 05e45e307b7d994bd70a8fccaebdc12c MD5 · raw file

  1. #!/bin/sh
  2. # $Id: gauge0-input-fd,v 1.5 2010/01/13 10:20:03 tom Exp $
  3. # modified "gauge0" script to use "--input-fd" option.
  4. . ./setup-vars
  5. exec 3<&0
  6. PCT=10
  7. (
  8. sleep 1
  9. while test $PCT != 110
  10. do
  11. cat <<EOF
  12. XXX
  13. $PCT
  14. The new\n\
  15. message ($PCT percent)
  16. XXX
  17. EOF
  18. PCT=`expr $PCT + 10`
  19. sleep 1
  20. done
  21. ) |
  22. $DIALOG --title "GAUGE" --input-fd 3 "$@" --gauge "Hi, this is a gauge widget" 0 0 0
  23. exec 3<&-