File: menu

package info (click to toggle)
splitvt 1.6.5-0potato1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 332 kB
  • ctags: 399
  • sloc: ansic: 4,684; sh: 78; makefile: 55; perl: 15
file content (49 lines) | stat: -rwxr-xr-x 1,032 bytes parent folder | download | duplicates (12)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
#	An example menu utilizing the SPLITVT environment variable.
#

# Portably echo a line with no trailing newline:
echo_n() {
	if [ "`echo -n \"\"`" = "" ]; then
		echo -n "$*"
	elif [ "`echo -e \"\\c\"`" == "" ]; then
		echo -e "$*\c"
	else 
		echo "$*\c"
	fi
}

if [ "$SPLITVT" = "upper" ]; then
	echo "This is the upper window MENU:"
	echo ""
	echo "1)	apples"
	echo "2)	oranges"
	echo "3)	bananas"
	echo ""
	echo_n "Enter your fruit of choice: "
	read fruit
	case $fruit in
		1)	echo "You like apples!";;
		2)	echo "You like oranges!";;
		3)	echo "You like bananas!";;
		*) echo "What fruit was that?";;
	esac
elif [ "$SPLITVT" = "lower" ]; then
	echo "This is the lower window MENU:"
	echo ""
	echo "1)	pickles"
	echo "2)	carrots"
	echo "3)	cabbage"
	echo ""
	echo_n "Enter your vegetable of choice: "
	read fruit
	case $fruit in
		1)	echo "You like pickles!";;
		2)	echo "You like carrots!";;
		3)	echo "You like cabbage!";;
		*) echo "What vegetable was that?";;
	esac
else
	echo "You are not running splitvt!"
fi