title: get the caller script of an exported function
body: <p>I have a script /usr/bin/test.sh which looks like that:</p>
  
  <pre><code>test_func()
  {
      echo "callertest 1:"
      cat /proc/$PPID/cmdline | tr '\0' ' '
      echo "callertest 2:"
      ps aux | grep $PPID
  }
  
  export -f test_func
  bash -c test_func
  </code></pre>
  
  <p>Because "/usr/bin" is in $PATH, i call the script with "test.sh". The function should echo the script's name or better full path, but i havent got any further than getting "bash". Seems to be an issue with scripts which are placed in $PATH.</p>