I write below shell script to check whether given character is in uppercase or lowercase..
read d
case $d in
[a-z]) echo "Character is in Lowercase";;
[A-Z]) echo "Character is in Uppercase";;
esac
But when I enter any case in Uppercase it displays the output "charecter is in Lowercase" I just want to create simple script with basic programming. Is there any solution??
Z
gives uppercase and all other gives lowercase... if you interchange the two statements,a
gives lowercase and every other letter gives uppercase.. I think it may be because case does pattern matching and not regex matching – Sundeep Aug 13 '16 at 10:33LC_COLLATE=C
– Cyrus Aug 13 '16 at 11:10