line='hi#how#are#you'
Tval=`echo ${line} | cut -d "#" -f 2`
counter="how" # defining the value is must
if [ $Tval = $counter ] # we can compare string using = only
then
echo "No of rows matched with T Value"
else
echo "Not matched"
fi
line='hi#111#are#you'
Tval=`echo ${line} | cut -d "#" -f 2`
if [ $Tval = $counter ] then
echo "No of rows matched with T Value"
else
echo "Not matched"
fi
i cut the field and store in the variable Tval.the Tval contains a string.
i want to convert it integer. because i want to use in if condiotion the other operator($counter ) is interger.