]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/dialog/samples/buildlist2
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / dialog / samples / buildlist2
1 #!/bin/sh
2 # $Id: buildlist2,v 1.6 2012/12/23 22:28:12 tom Exp $
3
4 . ./setup-vars
5
6 . ./setup-edit
7
8 count=0
9 ls -1 | while true
10 do
11         read filename
12         test -z "$filename" && break
13         case $filename in
14         *.*)
15                 state=off
16                 ;;
17         *-*)
18                 state=on
19                 ;;
20         *)
21                 continue
22                 ;;
23         esac
24         case "x$DIALOGOPTS" in
25         *--no-items*|*--noitem*)
26                 echo $filename $state >>$input
27                 ;;
28         *)
29                 echo $count $filename $state >>$input
30                 ;;
31         esac
32         count=`expr $count + 1`
33 done
34
35 $DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
36         --visit-items --scrollbar --separator "|" \
37         --buildlist "hello, this is a --buildlist..." 0 0 10 `cat $input` 2> $output
38
39 retval=$?
40
41 tempfile=$output
42 . ./report-tempfile