我想知道ksh中的任何命令是否等同于C的islower()函数?
答案 0 :(得分:2)
种类:您可以匹配模式[[:lower:]]
islower() {
[[ $1 == [[:lower:]] ]]
}
char=A
islower $char && echo $char is lower case || echo not lower case
char=a
islower $char && echo $char is lower case || echo not lower case