Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ZSH_SCRIPT



Peter Stephenson schreef op 01-03-16 om 16:07:
> On Tue, 1 Mar 2016 09:39:19 -0500
> Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
>> Should we explicitly document that ZSH_SCRIPT is empty rather than
>> unset when not invoked as a script?
> 
> That would probably be sensible.

Is there a particular reason why it should be empty rather than unset?
Unset seems more logical; if we're not running a script, the script name
is not the empty string but it doesn't exist. This would also make it
possible to do
	[[ -v ZSH_SCRIPT ]]
to check if you're in a script.

- M.



Messages sorted by: Reverse Date, Date, Thread, Author