title: Converting Bash command line options to variable name
body: <p>I am trying to write a bash script that takes in an option.
  Lets call these options A and B.</p>
  
  <p>In the script A and B may or may not be defined as variables.</p>
  
  <p>I want to be able to check if the variable is defined or not.</p>
  
  <p>I have tried the following but it doesn't work.</p>
  
  <pre><code>if [ ! -n $1 ]; then 
     echo "Error"
  fi
  </code></pre>
  
  <p>Thanks</p>