| 1 |
#!/bin/sh |
| 2 |
# $Id: menubox12,v 1.6 2020/11/26 00:03:58 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 |
PC-DOS:IBM PC DOS |
| 23 |
MS-DOS:Microsoft DOS |
| 24 |
EOF |
| 25 |
sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' <$input >$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 |
returncode=$? |
| 41 |
|
| 42 |
tempfile=$output |
| 43 |
. ./report-tempfile |