If I give a bash script a parameter on the command line, I can use this as the value later in the script. However, if I query the same string with read, I get a different value.
Example:
./test.sh utrre$fdg.dsf88^
#!/bin/bash
var=$1
read -e "Enter password: " test
if [ "$var" = "$test" ]; then
echo "Password match"
else
echo "Password not match"
fi
But I always get Password not match
. I assume this is because there are special signs in the string. How can I have both matching?