title: Confirming the number of valid input arguments of a shell function
body: <p>Assume a shell function <code>my_function</code> that expects to receive three valid input arguments:</p>
  
  <pre><code>my_function()
  {
     echo "Three common metasyntactic variables are: $1 $2 $3"
  }
  </code></pre>
  
  <p>I would like to include a test within <code>my_function</code> that assesses if the function has indeed received three input arguments <strong>and</strong> that none of these input arguments is empty.</p>
  
  <pre><code>$ my_function foo bar baz
  Three common metasyntactic variables are: foo bar baz
  
  $ my_function foo bar  # By default, no error message is given, which I wish to avoid
  Three common metasyntactic variables are: foo bar
  </code></pre>
  
  <p>How would I implement that?</p>
  
  <p><strong>Edit 1</strong>:
  As emphasized above, I am looking for code that not only confirms the number of input variables, but also confirms that none of them is empty. This second aspect is relevant because the input variables may be variables themselves that are passed from other functions.</p>