|
#!/bin/bash
echo "Hit a key, then hit return."
read Keypress
case "$Keypress" in
[a-z] ) echo "Lowercase letter";;
[A-Z] ) echo "Uppercase letter";;
[0-9] ) echo "Digit";;
* ) echo " unctuation, whitespace, or other";;
esac
exit 0
为什么输入大写字母也显示lowercase letter呢?
case有什么值得注意的地方么?
btw:linux 7.3 bash.谢谢 |
|