i have following if condition
if [ "$data_type" == "ASCII" ]
above statement is case sensitive.....what is syntax if i have to make above comparision case insensetive
i have following if condition
if [ "$data_type" == "ASCII" ]
above statement is case sensitive.....what is syntax if i have to make above comparision case insensetive
if [ "$data_type" = "ASCII" ] || \
[ "$data_type" = "ascii" ]
case "$data_type" in [Aa][Ss][Cc][Ii][Ii])echo OK;;*)echo KO;;esac
[[ "$data_type" = [Aa][Ss][Cc][Ii][Ii] ]]&&echo OK||echo KO
data_type=`echo $data_type | tr '[a-z]' '[A-Z]'`
if [ "$data_type" == "ASCII" ]
With ksh you can declare a variable with the attribute 'contains always uppercase' :
typeset -u UpperVar
UpperVar='AbCdEf'
echo $UpperVar # -> Ouput is : ABCDEF
In the same way you can use the -l option for lowercase contents.
jean-Pierre.