summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/dialog/TESTS/ftreebox
blob: 621dc1e4d640e1493ae0bd4013071b8e81e5c14e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
DIALOG=${DIALOG=/usr/bin/dialog}

find -xd / -type d > /tmp/ftreebox.tmp.$$

$DIALOG --clear --title "FTREE BOX" \
	--hline "Press arrows, TAB or Enter" \
	--hfile "../COPYING" \
	--ftree "/tmp/ftreebox.tmp.$$" "/" \
	"This is ftree box" \
	-1 -1 10 2>/tmp/ftree.tmp.$$

retval=$?

choice=`cat /tmp/ftree.tmp.$$`

case $retval in
  0)
    echo "'$choice' chosen.";;
  1)
    echo "Cancel pressed.";;
  255)
    [ -z "$choice" ] || echo $choice ;
    echo "ESC pressed.";;
esac

rm -f /tmp/ftreebox.tmp.$$ /tmp/ftree.tmp.$$
OpenPOWER on IntegriCloud