I have the following piece of code where I am trying to match the word "test" in the given string:
str="some test string"
if [ $str == *"test"* ]; then # [: too many arguments
echo "string was found"
else
echo "string was not found"
fi
Output:
string was not found
Bash version:
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
What am I doing wrong?