Debian Codegraph @

ex30a.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # ex30a.sh: "Colorized" version of ex30.sh.
3 # Crude address database
4
5
6 clearscip-shell system . . clear. # Clear the screen.
7
8 echoscip-shell system . . echo. -n " "
9 echoscip-shell system . . echo. -e '\E[37;44m'"\033[1mContact List\033[0m"
10 # White on blue background
11 echoscip-shell system . . echo.; echoscip-shell system . . echo.
12 echoscip-shell system . . echo. -e "\033[1mChoose one of the following persons:\033[0m"
13 # Bold
14 tputscip-shell system . . tput. sgr0 # Reset attributes.
15 echoscip-shell system . . echo. "(Enter only the first letter of name.)"
16 echoscip-shell system . . echo.
17 echoscip-shell system . . echo. -en '\E[47;34m'"\033[1mE\033[0m" # Blue
18 tputscip-shell system . . tput. sgr0 # Reset colors to "normal."
19 echoscip-shell system . . echo. "vans, Roland" # "[E]vans, Roland"
20 echoscip-shell system . . echo. -en '\E[47;35m'"\033[1mJ\033[0m" # Magenta
21 tputscip-shell system . . tput. sgr0
22 echoscip-shell system . . echo. "ambalaya, Mildred"
23 echoscip-shell system . . echo. -en '\E[47;32m'"\033[1mS\033[0m" # Green
24 tputscip-shell system . . tput. sgr0
25 echoscip-shell system . . echo. "mith, Julie"
26 echoscip-shell system . . echo. -en '\E[47;31m'"\033[1mZ\033[0m" # Red
27 tputscip-shell system . . tput. sgr0
28 echoscip-shell system . . echo. "ane, Morris"
29 echoscip-shell system . . echo.
30
31 read person
32
33 case "$person" in
34 # Note variable is quoted.
35
36 "E" | "e" )
37 # Accept upper or lowercase input.
38 echoscip-shell system . . echo.
39 echoscip-shell system . . echo. "Roland Evans"
40 echoscip-shell system . . echo. "4321 Flash Dr."
41 echoscip-shell system . . echo. "Hardscrabble, CO 80753"
42 echoscip-shell system . . echo. "(303) 734-9874"
43 echoscip-shell system . . echo. "(303) 734-9892 fax"
44 echoscip-shell system . . echo. "[email protected]"
45 echoscip-shell system . . echo. "Business partner & old friend"
46 ;;
47
48 "J" | "j" )
49 echoscip-shell system . . echo.
50 echoscip-shell system . . echo. "Mildred Jambalaya"
51 echoscip-shell system . . echo. "249 E. 7th St., Apt. 19"
52 echoscip-shell system . . echo. "New York, NY 10009"
53 echoscip-shell system . . echo. "(212) 533-2814"
54 echoscip-shell system . . echo. "(212) 533-9972 fax"
55 echoscip-shell system . . echo. "[email protected]"
56 echoscip-shell system . . echo. "Girlfriend"
57 echoscip-shell system . . echo. "Birthday: Feb. 11"
58 ;;
59
60 # Add info for Smith & Zane later.
61
62 * )
63 # Default option.
64 # Empty input (hitting RETURN) fits here, too.
65 echoscip-shell system . . echo.
66 echoscip-shell system . . echo. "Not yet in database."
67 ;;
68
69 esac
70
71 tputscip-shell system . . tput. sgr0 # Reset colors to "normal."
72
73 echoscip-shell system . . echo.
74
75 exit 0