Skip to main content

Module zsh

Module zsh 

Source
Expand description

The Zsh shell implementation. The Zsh shell implementation.

Zsh is a peer of Bash, not a flavor of it: it owns its builtin table (where, whence, which, print, and zsh-flavored echo, alias, export, type), its dialect (messages and prompt), and its grammar. The grammar today is the shared sh-family grammar (brush_parser), which is the honest state of affairs for a first zsh: zsh syntax was never formally specified and no maintained zsh grammar crate exists, so zsh-specific constructs (glob qualifiers, extended globbing, =command expansion, prompt escapes) are future work owned by this implementation on top of the shared ShellCore.

What already differs from Bash, verified against a real zsh:

  • echo interprets backslash escapes by default (BSD behavior);
  • alias lists as name='expansion' without a prefix;
  • export lists as export NAME=value;
  • type says name is an alias for ...;
  • the where/whence/which/print builtins;
  • the prompt (user@host:~/path% with the home directory abbreviated to ~).

Structsยง

Zsh
The Zsh-flavored shell.
ZshInterpreter
The behavior of /bin/zsh: the Zsh dialect as a program (#!/bin/zsh is interpreted by Zsh). Scripts and zsh -c invocations run through the same implementation as interactive commands.