I'm trying to compare strings. I get "command not found" error. How do I compare the strings?
Code:
#!/bin/bash
STR="Hello World"
if [$STR="Hello World"]; then
echo "passed test"
else
echo "didn't pass test"
fi
Output:
test.sh: line 4: [Hello: command not found
didn't pass test