]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/dialog/samples/menubox12
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / dialog / samples / menubox12
1 #!/bin/sh
2 # $Id: menubox12,v 1.3 2012/12/23 22:28:26 tom Exp $
3
4 . ./setup-vars
5
6 . ./setup-edit
7
8 case "x$DIALOGOPTS" in
9 *--no-items*|*--noitem*)
10         CUT="cut -d: -f1,3"
11         ;;
12 *)
13         CUT="cat"
14         ;;
15 esac
16
17 $CUT >$input <<-EOF
18         Linux:The Great Unix Clone for 386/486
19         NetBSD:Another free Unix Clone for 386/486
20         OS/2:IBM OS/2
21         WIN NT:Microsoft Windows NT
22         PCDOS:IBM PC DOS
23         MSDOS:Microsoft DOS
24 EOF
25 cat $input | sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' >$output
26 cat $output >$input
27
28 $DIALOG --clear --title "MENU BOX" "$@" \
29         --menu "Hi, this is a menu box. You can use this to \n\
30 present a list of choices for the user to \n\
31 choose. If there are more items than can fit \n\
32 on the screen, the menu will be scrolled. \n\
33 You can use the UP/DOWN arrow keys, the first \n\
34 letter of the choice as a hot key, or the \n\
35 number keys 1-9 to choose an option.\n\
36 Try it now!\n\n\
37         Choose the OS you like:" 20 51 4 \
38         --file $input 2> $output
39
40 retval=$?
41
42 tempfile=$output
43 . ./report-tempfile