http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net
发布时间:2011-10-12 21:22:14
#!/bin/shtrapper () { echo "In trapper" trap 'echo "Caught in a trap!"' 2 # Once set, this trap affects the entire script. Anytime # ^C is entered, the script will ignore it.}while :do echo "In the main script" trapper echo "Still in main"&nb.........【阅读全文】
发布时间:2011-10-12 21:12:42
#!/bin/sh# Program opts2# Using getopts -- Second try --while getopts xy options 2> /dev/nulldo case $options in x) echo "you entered -x as an option";; y) echo "you entered -y as an option";; \?) echo "Only -x and -y are valid options" 1>&2;; esacdone.........【阅读全文】