write a shell script to identify the given string is
palindrome or not?
Answer Posted / kirtiranjan sahoo
read -p "Enter a string : " st
rvs=`echo $st | rev`
if [ $st == $rvs ]
then
echo "Palindrome"
else
echo "Not Palindrome"
fi
Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is a shell environment?
How will you emulate wc –l using awk?
How to set an array in linux?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
What are different types of shell?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
How do I read a .sh file?
Write a shell script to get current date, time, user name and current working directory.
How do you know which shell I am using?
What does $1 mean in bash?
What is the best scripting language?
How to write a function?
What are the various stages of a linux process it passes through?
How do you find out What is your shell?
What does the sh command do?