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