title: How to catch missing argument in function mistake?
body: <p>I have just made the following mistake, where I am passing an argument to a function which is empty.</p>
  
  <pre><code>var1="ok"
  var2=$notDefined
  
  func $var1 $var2
  func() {
    var1=$1
    var2=$2
    echo $var1
    echo $var2
  }
  </code></pre>
  
  <p>For each argument in the function I could do</p>
  
  <pre><code>if [ -z $1 ]; then echo "Empty argument"; fi
  </code></pre>
  
  <p>But is there a more generic method to do this, so it is easy reusable, and would perhaps even tell the variable name that is empty?</p>