write a shell script to identify the given string is
palindrome or not?
Answer Posted / dhyan@addiction
# PROGRAM TO FIND OUT WHETHER THE A INPUTED STRING IS
PALINDROME OR NOT.
echo -n "Please enter a string: "
read input_string
echo $input_string >> temp
reversed_string="$(rev temp)"
if [ $input_string = $reversed_string ]
then
echo -e "The string$input_string is palindrome\n"
else
echo -e "This string is not palindrome\n"
fi
rm temp #to use same file again and again
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
What is the best shell scripting language?
Why is a script important?
Given a file find the count of lines containing the word "abc".
How to print the first array element?
Is bash an operating system?
What is a shell environment?
What is sudo command?
Is scripting and coding the same thing?
How are shells born?
Is shell scripting a language?
What is option in shell script?
How to check if the previous command was run successfully?
What are the two files of crontab command?
How will you find the 99th line of a file using only tail and head command?
What are the 3 standard streams in linux?