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
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What is subshell?
What is the first line of a shell script called?
What is mac default shell?
Is shell scripting a programming language?
How to find all the files modified in less than 3 days and save the record in a text file?
What is the use of echo in shell script?
What is a shell script? Can you name some of its advantages?
What exactly is a shell?
What are the different types of variables used in shell script?
What is scripting used for?
What is shell company all about?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What is sed in shell script?
write a shell script to check the failed jobs?