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
How do I debug a shell script?
What is shell and terminal?
What is a command line shell?
How to write a function?
How do I set bash as default shell mac?
What is the use of break command?
How do I run a script from command prompt?
What will happen to my current process when I execute a command using exec?
What is batch file programming?
What is a shell made of?
How can I set the default rwx permission to all users on every file which is created in the current shell?
What is echo $shell?
What does echo $0 do?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
Print the 10th line without using tail and head command.