This may be a duplicate of bash user input if, but the answers do not solved my problem, so I think there is something else.
I have the next script:
#!/bin/bash
echo "Do that? [Y,n]"
read input
if [[ $input == "Y" || $input == "y" ]]; then
echo "do that"
else
echo "don't do that"
fi
and when I do sh basic-if.sh
Also I have
#!/bin/bash
read -n1 -p "Do that? [y,n]" doit
case $doit in
y|Y) echo yes ;;
n|N) echo no ;;
*) echo dont know ;;
esac
and when I do sh basic-if2.sh
I think my bash has a problem because appereatly the other users didn't have these problems running those examples. Thanks