Bash Check Palindrome
check_palindrome() {
local _s=$1
local _rev=""
local _i
for ((_i = ${#_s} - 1; _i >= 0; _i--)); do
_rev="${_rev}${_s:_i:1}"
done
if [[ "$_rev" == "$_s" ]]; then echo true; else echo false; fi
}
This compares the string with its reverse. If they match, it is a palindrome.