~ubuntu-branches/ubuntu/natty/splitvt/natty

« back to all changes in this revision

Viewing changes to examples/menu

  • Committer: Bazaar Package Importer
  • Author(s): Julien Danjou
  • Date: 2008-08-03 14:19:50 UTC
  • mfrom: (4.1.4 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080803141950-x7y3hxnxqoekgnp3
Tags: 1.6.6-7
* QA upload.
* Fix bashisms (Closes: #489663)
* Bump standard version

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#       An example menu utilizing the SPLITVT environment variable.
4
4
#
5
5
 
6
 
# Portably echo a line with no trailing newline:
7
 
echo_n() {
8
 
        if [ "`echo -n \"\"`" = "" ]; then
9
 
                echo -n "$*"
10
 
        elif [ "`echo -e \"\\c\"`" == "" ]; then
11
 
                echo -e "$*\c"
12
 
        else 
13
 
                echo "$*\c"
14
 
        fi
15
 
}
16
 
 
17
6
if [ "$SPLITVT" = "upper" ]; then
18
7
        echo "This is the upper window MENU:"
19
8
        echo ""
21
10
        echo "2)        oranges"
22
11
        echo "3)        bananas"
23
12
        echo ""
24
 
        echo_n "Enter your fruit of choice: "
 
13
        printf "Enter your fruit of choice: "
25
14
        read fruit
26
15
        case $fruit in
27
16
                1)      echo "You like apples!";;
36
25
        echo "2)        carrots"
37
26
        echo "3)        cabbage"
38
27
        echo ""
39
 
        echo_n "Enter your vegetable of choice: "
 
28
        printf "Enter your vegetable of choice: "
40
29
        read fruit
41
30
        case $fruit in
42
31
                1)      echo "You like pickles!";;