xref: /freebsd/contrib/dialog/samples/menubox12 (revision 40a8ac8f62b535d30349faf28cf47106b7041b83)
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
8case "x$DIALOGOPTS" in
9*--no-items*|*--noitem*)
10	CUT="cut -d: -f1,3"
11	;;
12*)
13	CUT="cat"
14	;;
15esac
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
24EOF
25cat $input | sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' >$output
26cat $output >$input
27
28$DIALOG --clear --title "MENU BOX" "$@" \
29        --menu "Hi, this is a menu box. You can use this to \n\
30present a list of choices for the user to \n\
31choose. If there are more items than can fit \n\
32on the screen, the menu will be scrolled. \n\
33You can use the UP/DOWN arrow keys, the first \n\
34letter of the choice as a hot key, or the \n\
35number keys 1-9 to choose an option.\n\
36Try it now!\n\n\
37	Choose the OS you like:" 20 51 4 \
38	--file $input 2> $output
39
40retval=$?
41
42tempfile=$output
43. ./report-tempfile
44