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

Answer Posted / rag sagar.v

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 ?    409 Yes 149 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1680


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

716


what is info area how many types?

2287


Why is used in shell scripting?

556


Explain about shebang?

620






How can I send a mail with a compressed file as an attachment?

556


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.

2226


What is c in shell script?

632


What are the different communication commands available in the shell?

515


What is bash command used for?

579


How do we create command aliases in a shell?

538


How many fields are present in a crontab file and what does each field specify?

580


What happens when you type ls?

558


Write the syntax for "if" conditionals in linux?

591


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

1718