# echo hello | rev
olleh
# echo hello > test.txt
# echo world >> test.txt
# rev test.txt
olleh
dlrow
#!/bin/bash
word=$1
if [[ "$word" == "$(echo $word | rev)" ]];
then
echo "$word is Palindrome"
fi
# ./revchk.sh poop
poop is Palindrome
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |