Re: bash: path of script that is being executed
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- Date: 25 Sep 2006 08:58:11 GMT
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
.
- Follow-Ups:
- Re: bash: path of script that is being executed
- From: Angel Tsankov
- Re: bash: path of script that is being executed
- From: Hubble
- Re: bash: path of script that is being executed
- References:
- bash: path of script that is being executed
- From: Angel Tsankov
- bash: path of script that is being executed
- Prev by Date: Re: eval a command
- Next by Date: Re: bash: path of script that is being executed
- Previous by thread: bash: path of script that is being executed
- Next by thread: Re: bash: path of script that is being executed
- Index(es):