You are on page 1of 1

pali=1

read P
declare h=1

for ((i=0,j=${#P}-1;i<${#P};i++,j--))
do
if [ ${P:i:1} != ${P:j:1} ]
then
h=0
fi
done

if((h==1)); then
echo "si es palindrome"
else
echo "no es palindrome"
fi

You might also like