read text
text=`echo $text|tr -c -d [:alpha:]`
r_text=`echo $text|rev`
if [ $text = $r_text ];then
echo success
else
echo failed
fi
这个基本满足你的要求, 但是输入的字符串不能有空格
#!/bin/bash
read text
text=`echo $text | tr -c -d [:alpha:]`
r_text=`echo $text | rev`
echo "r_text:"$r_text
if [ $text == $r_text ];then
echo success
else
echo failled
fi