getopts1.ksh
来自「Solaris环境下Shell编程编程」· KSH 代码 · 共 29 行
KSH
29 行
#!/bin/ksh# Script name: getopts1.kshUSAGE="usage: $0 [-d] [-m month]"year=$(date +%Y)while getopts :dm: opt_chardo case $opt_char in d) print -n "Date: " # -d option given date ;; m) cal $OPTARG $year # -m option given with an arg ;; \?) print "$OPTARG is not a valid option." print "$USAGE" ;; esacdone
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?