title: Why doe the shell script does not accept first argument
body: <p>I am new to unix shell scripting. I am trying to execute sample function with arguments but the shell does not recognize the first argument as first but rather as second.</p>
  
  <pre><code>#!/bin/bash
  func(){
      echo "func"
      if [ -z $1 ]
      then echo "$1 received"
      else echo "not received"
      fi
      }
  func "hello"
  </code></pre>
  
  <p>gives output
      func
      not received</p>
  
  <p>where it should have given</p>
  
  <pre><code>func
  hello received
  </code></pre>