given the following code:
x="my_string123"
# 1)
if [[ "${x}" = "my_s"* ]] ; then
echo "YES"
else
echo "NO"
fi
# 2)
if test "${x}" == "my_string123" ; then
echo "YES"
else
echo "NO"
fi
# 3)
if test "${x}" == "my_str"* ; then
echo "YES"
else
echo "NO"
fi
I get this output:
YES
YES
NO
But i not sure why i get from the last "NO".
After all, I used regex * and therefore I would expect to get YES.
What am I missing here?