1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

37895: $ZSH_SCRIPT is POSIX $0 but always availble

This commit is contained in:
Peter Stephenson 2016-02-07 21:01:08 +00:00
parent dd2aa85807
commit 1ab316c9b8
2 changed files with 8 additions and 0 deletions

View file

@ -951,6 +951,13 @@ track of versions of the shell during development between releases;
hence most users should not use it and should instead rely on
tt($ZSH_VERSION).
)
vindex(ZSH_SCRIPT)
item(tt(ZSH_SCRIPT))(
If zsh was invoked to run a script, this is the name of the script.
Otherwise, it is the name used to invoke the current shell. This is
the same as the value of tt($0) when the tt(POSIX_ARGZERO) option is
set, but is always available.
)
item(tt(zsh_scheduled_events))(
See ifzman(the section `The zsh/sched Module' in zmanref(zshmodules))\
ifnzman(noderef(The zsh/sched Module)).

View file

@ -813,6 +813,7 @@ createparamtable(void)
setsparam("TTY", ztrdup_metafy(ttystrname));
setsparam("VENDOR", ztrdup_metafy(VENDOR));
setsparam("ZSH_NAME", ztrdup_metafy(zsh_name));
setsparam("ZSH_SCRIPT", ztrdup(posixzero));
setsparam("ZSH_VERSION", ztrdup_metafy(ZSH_VERSION));
setsparam("ZSH_PATCHLEVEL", ztrdup_metafy(ZSH_PATCHLEVEL));
setaparam("signals", sigptr = zalloc((SIGCOUNT+4) * sizeof(char *)));