Re: bash: path of script that is being executed



Stephane Chazelas wrote:
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

$0 is in many shells what the invoking shell passes as argv[0] and is
not reliable. The question is a FAQ. The answer is: if you want this as
info, you can use it. If you try to treat the value as reliable (for
example to find additional files in the same directory), don't use it.

Hubble.

.