write a shell program to check wheather a given string is
pallindrome or not?
Answer Posted / mahesh gupta
this script is written for bash :
echo Enter the string
read s
echo $s > temp
rvs="$(rev temp)"
if [ $s = $rvs ]
then
echo "it is palindrome"
else
echo " it is not"
fi
| Is This Answer Correct ? | 21 Yes | 6 No |
Post New Answer View All Answers
What is the use of echo in shell script?
How to get the 3rd element/column from each line from a file?
Explain about login shell?
How to print all the arguments provided to the script?
What is the significance of the shebang line in shell scripting?
Can you write a script to portray how set –x works?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
What shell is bin sh?
What exactly is a shell?
How to use arguments in a script?
c program to display the information of given file similar to givan by the unix or linux command ls -l
How can the contents of a file inside jar be read without extracting in a shell script?
How does ls command work?
What are the various stages of a linux process it passes through?
How to pass an argument to a script?