Zsh tries to emulate sh or ksh when it is invoked as
sh or ksh respectively. In this mode the following
parameters are not special and not initialized by the shell:
ARGC,
argv,
cdpath,
fignore,
fpath,
HISTCHARS,
mailpath,
MANPATH,
manpath,
path,
prompt,
PROMPT,
PROMPT2,
PROMPT3,
PROMPT4,
psvar,
status,
watch.
The usual zsh startup/shutdown scripts are not executed. Login shells
source /etc/profile followed by $HOME/.profile. If the
ENV environment variable is set on invocation, $ENV is sourced
after the profile scripts. The value of ENV is subjected to
parameter expansion, command substitution, and arithmetic expansion before
being interpreted as a pathname. Note that the PRIVILEGED option
also affects the execution of startup files.
The following options are set if the shell is invoked as sh or
ksh:
NO_BAD_PATTERN,
NO_BANG_HIST,
NO_BG_NICE,
NO_EQUALS,
NO_FUNCTION_ARGZERO,
GLOB_SUBST,
NO_HUP,
INTERACTIVE_COMMENTS,
KSH_ARRAYS,
NO_MULTIOS,
NO_NOMATCH,
NO_NOTIFY,
POSIX_BUILTINS,
NO_PROMPT_PERCENT,
RM_STAR_SILENT,
SH_FILE_EXPANSION,
SH_GLOB,
SH_OPTION_LETTERS,
SH_WORD_SPLIT.
Additionally the BSD_ECHO and IGNORE_BRACES
options are set if zsh is invoked as sh.
Also, the
KSH_OPTION_PRINT,
LOCAL_OPTIONS,
PROMPT_BANG,
PROMPT_SUBST
and
SINGLE_LINE_ZLE
options are set if zsh is invoked as ksh.
Go to the first, previous, next, last section, table of contents.