Jon:
Hi Henk,


# This has to be the first thing run at top of script!

if [ "$_" = "$0" ]
   then : #echo " Script is a subshell"
   else : #echo " Script is being sourced"
fi

Sorry Jon,

Have you tested this?  I get different results.

$ ksh -x script
[3]+ [[ /usr/bin/ksh == script ]]
[6]+ print sourced
sourced
$ nl script
     1  #!/bin/ksh

     2  if [[ $_ == $0 ]]; then
     3     print subshell
     4  else
     5     print sourced
     6  fi
vi
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to