The sample scripts below, I am looking for the location of the sourced b.sh file. The b.sh file is source by multiple files, so it is not feasible to rely on a "global" variable or passed argument. Is there any way to determine the location of b.sh within b.sh?
a.sh
Code:
#!/bin/ksh
echo "a: <$0>"
ScriptDir=`dirname $0`
. ${ScriptDir}/b.sh