I am trying to check if a string is a palindrome in bash. Here is what I came up with:
#!/bin/bash read -p \"Enter a string: \" string if [[ $string|rev ==
Use $(command substitution):
$(command substitution)
#!/bin/bash read -p "Enter a string: " string if [[ "$(echo "$string" | rev)" == "$string" ]]; then echo "Palindrome" fi