]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/dialog/samples/infobox6
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / dialog / samples / infobox6
1 #! /bin/sh
2 # $Id: infobox6,v 1.7 2011/01/18 09:20:59 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 #
6 # a little fancier than infobox5, this moves the widget at each step.
7
8 . ./setup-vars
9
10 . ./setup-tempfile
11
12 left=10
13 unit="seconds"
14 last='\'
15
16 cat >>$tempfile <<EOF
17 $DIALOG $last
18 EOF
19
20 while test $left != 0
21 do
22
23 cat >>$tempfile <<EOF
24         --sleep 1 \
25         --begin $left `expr $left + 5` \
26         --title "INFO BOX" $* $last
27         --infobox "Hi, this is an information box. It is
28 different from a message box: it will
29 not pause waiting for input after displaying
30 the message. The pause here is only introduced
31 by the sleep command within dialog.
32 You have $left $unit to read this..." 0 0 $last
33 EOF
34
35 left=`expr $left - 1`
36 test $left = 1 && unit="second"
37 done
38
39 echo >>$tempfile
40
41 . $tempfile