Re: bash: path of script that is being executed



On Mon, 25 Sep 2006 09:22:53 +0300, Angel Tsankov wrote:
How can a script that is being executed determine its path? What
if the script has been sourced?

$0

${BASH_SOURCE[0]} (aka $BASH_SOURCE)

if it is being sourced (bash >= 3 only)

With zsh, it's $0 for both.

--
Stephane
.