I have my shell script, myscript.sh below
#!/bin/sh
if [ $1 = "-r" ]; then
echo "I am here"
fi
If I run with . myscript.sh -r, it works well with message I am here.
But if I just run with . myscript.sh, it complaints
-bash: [: =: unary operator expected
What's missing in my script?