write a shell script to identify the given string is
palindrome or not?

Answer Posted / abhijeet chavan (cts)

set -x
input_string=$1
if [ -z "$input_string" ] ; then
echo "Please enter a Text along with the script name\n"
exit
fi

reversed_string=$(rev $input-string)
if [ "$input_string" -eq "$reverse_string" ] ; then
echo "The String $input_String is a Palindrome"
else
echo "This string is not a palindrome"
fi

Is This Answer Correct ?    49 Yes 51 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is tickets $ what low,medium,high priorite pls define time also

1725


What is in a script?

573


c program to display the information of given file similar to givan by the unix or linux command ls -l

1701


What does path stand for?

640


What is the difference between break and continue commands?

579






Can we run shell script in windows?

585


Is cmd a shell?

600


What makes c shell a more preferable option than the bourne shell?

544


How do I open a jshell in cmd?

604


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

560


What are the advantages of using shell scripts?

589


Write down the syntax for all the loops in shell scripting.

666


What is an sh file?

563


Can shell script run on windows?

572


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

3591