leap2.ksh
来自「Solaris环境下Shell编程编程」· KSH 代码 · 共 24 行
KSH
24 行
#!/bin/ksh# Script name: leap2.ksh# Assume the user enters the year on the command line # when they execute the script.if [ $# != 1 ]then echo "You need to enter the year." exit 1fiyear=$1if (( ( year % 400 ) == 0 )) || (( ( year % 4 ) == 0 && ( year % 100 ) != 0 ))then print "$year is a leap year!"else print "$year is not a leap year."fi
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?