http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net
发布时间:2011-10-12 23:14:32
# This script is called colorsecho -n "Which color do you like? "set color = $<switch ("$color")case bl*: echo I feel $color echo The sky is $color breaksw case red: # Is is red or is it yellow? &nb.........【阅读全文】
发布时间:2011-10-12 23:10:59
#!/bin/csh -f# This script is called baseballecho -n "What baseball hero died in August 1995? "set answer = $<while ("$answer" !~ [Mm]*) echo "Wrong\! Try again." set answer = $< if ( "$answer" =~ [Mm]* ) break endecho "You are a scholar.".........【阅读全文】
发布时间:2011-10-12 23:05:40
#!/bin/tcsh -f# Scriptname: filetest2foreach file (`ls`) if ( -rwf $file ) then echo "${file}: readable/writeable/plain file" endifend......【阅读全文】
发布时间: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.........【阅读全文】