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 scripting language?
What language is shell scripting?
What is the purpose of scripting?
What exactly is a shell?
What is bash command used for?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
How do you debug a script?
Can we run shell script in windows?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
What command needs to be used to take the backup?
What language is bash?
What is shell and terminal?
What is an inode block?
How to print all the arguments provided to the script?
What are types of shells?