📄 ex30a.sh
字号:
#!/bin/bash# ex30a.sh: "Colorized" version of ex30.sh.# Crude address databaseclear # Clear the screen.echo -n " "echo -e '\E[37;44m'"\033[1mContact List\033[0m" # White on blue backgroundecho; echoecho -e "\033[1mChoose one of the following persons:\033[0m" # Boldtput sgr0echo "(Enter only the first letter of name.)"echoecho -en '\E[47;34m'"\033[1mE\033[0m" # Bluetput sgr0 # Reset colors to "normal."echo "vans, Roland" # "[E]vans, Roland"echo -en '\E[47;35m'"\033[1mJ\033[0m" # Magentatput sgr0echo "ones, Mildred"echo -en '\E[47;32m'"\033[1mS\033[0m" # Greentput sgr0echo "mith, Julie"echo -en '\E[47;31m'"\033[1mZ\033[0m" # Redtput sgr0echo "ane, Morris"echoread personcase "$person" in# Note variable is quoted. "E" | "e" ) # Accept upper or lowercase input. echo echo "Roland Evans" echo "4321 Floppy Dr." echo "Hardscrabble, CO 80753" echo "(303) 734-9874" echo "(303) 734-9892 fax" echo "revans@zzy.net" echo "Business partner & old friend" ;; "J" | "j" ) echo echo "Mildred Jones" echo "249 E. 7th St., Apt. 19" echo "New York, NY 10009" echo "(212) 533-2814" echo "(212) 533-9972 fax" echo "milliej@loisaida.com" echo "Girlfriend" echo "Birthday: Feb. 11" ;;# Add info for Smith & Zane later. * ) # Default option. # Empty input (hitting RETURN) fits here, too. echo echo "Not yet in database." ;;esactput sgr0 # Reset colors to "normal."echoexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -