PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 6. ./setup-vars
 7
 8. ./setup-tempfile
 9
10left=10
11unit="seconds"
12last='\'
13
14cat >>$tempfile <<EOF
15$DIALOG $last
16EOF
17
18while test $left != 0
19do
20
21cat >>$tempfile <<EOF
22	--sleep 1 \
23	--begin 0 5 \
24	--title "INFO BOX" $* \
25        --infobox "Hi, this is an information box. It is
26different from a message box: it will
27not pause waiting for input after displaying
28the message. The pause here is only introduced
29by the sleep command within dialog.
30You have $left $unit to read this..." 0 0 $last
31EOF
32
33left=`expr $left - 1`
34test $left = 1 && unit="second"
35done
36
37echo >>$tempfile
38
39. $tempfile