1------------ 2ZSH FEATURES 3------------ 4 5(Note that this file only lists basic shell features, for those who 6may not have encountered zsh before. Those familiar with zsh are 7unlikely to find anything new here.) 8 9very close to ksh/sh grammar, with csh additions 10most features of ksh, bash, and tcsh 11can emulate ksh or POSIX sh 12100 builtins, 145 options, 166 key bindings 13short for loops, ex: for i (*.c) echo $i 14select 15shell functions 16autoloaded functions (loaded from a file when they are first referenced) 17conditional expressions (test builtin, [ ... ], and ksh-style [[ ... ]]) 18global aliases (may be expanded anywhere on the line) 19directory stack access with ~num 20process substitution (vi =(cmd) edits the output of cmd) 21generalized pipes (ls foo >>(cmd1) 2>>(cmd2) pipes stdout to cmd1 22 and stderr to cmd2) 23arithmetic expressions 24advanced globbing: 25 ls **/file searches recursively for "file" in subdirectories 26 ls file<20-> matches file20, file21, file22, etc. 27 ls *.(c|pro) matches *.c and *.pro 28 ls *(R) matches only world-readable files 29 ls *.c~lex.c matches all .c files except lex.c 30 ls (#a1)README matches README with one error, e.g. RADME, REEDME, RAEDME 31 ls (#ia1)README same but case insensitive 32qualifiers in parentheses after globbing expression: 33 ls *(*@) matches executable files/directories or symlinks 34 ls *(L0f.go-w.) matches all zero-length files not group or world writable 35 ls *(om[1,3]) matches the three most recently modified files 36 ls *(om[2]) matches the second most recently modified file 37null command shorthands: 38 "< file" is same as "more <file" 39 "> file" is same as "cat >file" 40 ">> file" is same as "cat >>file" 41ksh-style coprocesses 42automatic file stream teeing (ls >foo >bar puts output in two places) 43chpwd() function run every time you change directory (useful for 44 updating the status line) 45job control 46csh-style history 47full vi line editing, including "c2w" and "y$" and such things 48full emacs line editing 49line editor is programmable via shell functions 50 - access and manipulate editor state via builtins and parameters 51 - user-defined `widgets' behave like other editor functions 52 - keymap customisation 53 - example functions provided 54incremental history search 55magic-space history 56spelling correction 57array parameters 58associative array parameters 59tie parameters a la path/PATH, e.g. ld_library_path/LD_LIBRARY_PATH 60$MACHTYPE, $VENDOR and $OSTYPE identify the host machine 61$LINENO, $RANDOM, $SECONDS, $cdpath, $COLUMNS, $fignore, $HISTCHARS, $mailpath 62$UID, $EUID, $GID, $EGID and $USERNAME can be assigned to 63with autocd option, typing a directory name by itself is the same as 64 typing "cd dirname" 65incremental path hashing 66automatic process time reporting for commands that run over a certain limit 67full tcsh-style prompt substitution plus conditional prompt expressions 68utmp login/logout reporting 69with histverify option, performing csh-style history expansions causes the 70 input line to be brought up for editing instead of being executed 71with sunkeyboardhack option, accidentally typed trailing ` characters 72 are removed from the input line (for those of you with Sun keyboards :-) ) 73with KEYBOARD_HACK, any accidentally typed trailing ascii character can be junked 74"cd old new" replaces "old" with "new" in directory string 75generalized argument completion, new system based on shell functions: 76 - highly context sensitive 77 - large (and I mean large) set of completions supplied, from a2ps to zstyle 78 - partial file path completion 79 - spelling correction and approximate completion of any completable word 80 - highly configurable expansion of shell arguments 81 - completion list colouring [`colorizing' for you lot over there] 82 - selection of completion elements with the cursor 83 - full scrolling of lists (in optional module) 84 - completion of words from the history list 85 - `styles' feature for versatile configuration 86 - `tags' feature for choosing completions preferentially 87 - `match' specifications, allowing e.g. 88 - variant forms: NO_glob, noglob, _NOGLOB_ all from the keyword glob 89 - partial-word matches with arbitrary anchors, e.g. 90 z_t.c -> zle_tricky.c 91 c.u.s -> comp.unix.shell 92 - complete control over case-insensitive matching 93 - can be defined globally or for individual completions 94 - bindable special completion functions 95menu completion: pressing TAB repeatedly cycles through the possible matches 96prompt on right side of screen 97directory stacks 98history datestamps and execution time records 99command scheduling (like at(1), but in the shell's context) 100tty mode freezing 101up to 9 startup files (but you only need 1 or 2) 102really 8-bit clean, and we mean it this time 103which -a cmd lists all occurrences of "cmd" in the path 104floating point support 105dynamically loadable binary modules, supplied modules include 106 - an FTP client which runs in the shell, with function suite 107 - math functions 108 - builtin interface to the `stat' system command 109 - builtin versions of standard commands (mv, ln, etc.) for emergencies 110 - special parameters to access internal state of hash tables etc. 111 - special associative array to access contents of files directly 112 - profiler for shell functions 113 - a pseudo-terminal handler, for purposes like `expect' 114 - builtins for interaction with termcap and terminfo 115