Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to compare a character to uppercase in bash script

echo "enter a char"
read c

if [[ $c == [A-Z] ]];
then
    echo "upper"
elif [[ $c == [a-z] ]];
then
    echo "lower"
else 
    echo "Digit or special symbols!"
fi
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #compare #character #uppercase #bash #script
ADD COMMENT
Topic
Name
4+8 =