Professional Documents
Culture Documents
Palindrome
Palindrome
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