但使岁月静好,现世安稳
dengjin
全部博文(92)
程序书籍信息(1)
那些只言片语(0)
心情记录(12)
电影感受(2)
2011年(6)
2010年(27)
2009年(37)
2008年(22)
浪花小雨
Bsolar
jdgdf566
scq2099y
woshiyiz
qianying
VIP_fuck
zhugezil
wojiaowx
分类: LINUX
2010-02-14 15:37:22
#!/bin/bashSKIPBLANKS=TMPDIR=/tmpCASE=lowerwhile getopts :bt:u argdo case $arg in b) SKIPBLANKS=TRUE echo "If skip blanks? $SKIPBLANKS" ;; t) if [ -d "$OPTARG" ] then TMPDIR=$OPTARG echo "Temp dir is $TMPDIR." else echo "$0: $OPTARG is not a directory." >&2 exit 1 fi ;; u) CASE=upper echo "Case sensitivity is $CASE." ;; :) echo "$0: Must supply an argument to -$OPTARG." >&2 exit 1 ;; \?) echo "Invalid option -$OPTARG ignored." >&2 ;; esacdone
#!/bin/bash
SKIPBLANKS
=
TMPDIR
=/tmp
CASE
=lowerwhile getopts :bt:u argdo case $arg in b)
=TRUE echo "If skip blanks? $SKIPBLANKS" ;; t) if [ -d "$OPTARG" ] then
=$OPTARG echo "Temp dir is $TMPDIR." else echo "$0: $OPTARG is not a directory." >&2 exit 1 fi ;; u)
=upper echo "Case sensitivity is $CASE." ;; :) echo "$0: Must supply an argument to -$OPTARG." >&2 exit 1 ;; \?) echo "Invalid option -$OPTARG ignored." >&2 ;; esacdone
上一篇:分享一些我的电子书
下一篇:Linux Shell 指令之trap
登录 注册