linux - checking if a string is a palindrome -


I'm trying to check if a string is a pilot in a bull. Here is where I came with:

  #! / Bin / bash read -p "Enter a string:" string if [[$ string | Rev == $ string]]; Then echo "Pyrenothrome" Fi  

, now resonate $ string | Rev gives the following string, my argument was in condition for this if . He was not doing so well

So, how can I store "return value" in a variable from rev ? Or use it directly in any condition?

without another change inside and unnecessary Excerpt: <[...]] :

  #! / Bin / bash read -p "Enter a string:" if the string [[$ (REV << lt; $ string) == "$ string"]]; Then resume the Pyramondrome F  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -