how can i check if
read -n 1 LETTER;
LETTER is a capital letter and after translate in minuscule.
i have thought with:
tr [A-Z] [a-z]
or no?
how can i check if
read -n 1 LETTER;
LETTER is a capital letter and after translate in minuscule.
i have thought with:
tr [A-Z] [a-z]
or no?
if [ $(echo $LETTER|grep '[A-Z]') ];then echo CAPITAL;else echo NOT;fi
I can't see anything wrong with what you posted:
echo "TeSt" | tr '[A-Z]' '[a-z]'
test
Why you need to check then translate?
yes but i must put the letter translate into $LETTER
$ LETTER=A; B=$(echo $LETTER| tr '[A-Z]' '[a-z]');echo $B
a
i solved with this code:
if [ $(echo $LETTER|grep '[A-Z]') ]; then
lettera=`echo $LETTER|tr [A-Z] [a-z]`;
fi;
# read -n 1 LETTER
T
# LETTER=`echo "${LETTER}" | tr '[A-Z]' '[a-z]'`
# echo "${LETTER}"
t
in ksh:
# LETTER=A
# typeset -l LETTER
# echo $LETTER
a