|
我按照版主的建议看了置顶的教程.特别是if的看是看懂了.但在写的时候.却检查不出是哪个地方错了.我把源程序打印出来给老师看.老师也看不出.我想大家也应该是能够看出这个程序的作用的.就是把cal 的功能稍微改动一下而已.
#
if ( $# -ne 2 ) then
echo You must input the month and years
else
switch ($1)
case "January":
cal 1 $2
breaksw
case "February":
cal 2 $2
breaksw
case "March":
cal 3 $2
breaksw
case "April":
cal 4 $2
breaksw
case "May":
cal 5 $2
breaksw
case "June":
cal 6 $2
breaksw
case "July":
breaksw
case "July":
cal 7 $2
breaksw
case "August":
cal 8 $2
breaksw
case "September":
cal 9 $2
breaksw
case "October":
cal 10 $2
breaksw
case "November":
cal 11 $2
breaksw
case "December":
cal 12 $2
breaksw
default:
echo "lease input right month!
endif
大家可以看到.我在if的后面和表达式是有加上空格的.
小弟愚昧.还请兄弟多多指点. |
|