title: Unix function can not called after switch user in shell script
body: <p>The below script executing with root user.After switch user Unix function showing error.</p>
  
  <h2>test.sh</h2>
  
  <pre><code>#!/bin/bash
  fn_test()
  {
  echo "This is function"
  }
  whoami
  fn_test
  su - oracle&lt;&lt;EOF
  whoami
  fn_test #This function not called
  EOF
  exit 0
  
  O/P
  root $ ./test.sh
  root
  This is function
  oracle
  -ksh[2]: fn_test: not found [No such file or directory]
  </code></pre>