Comparison of command shells#Integrated environment

{{Short description|none}}

{{further|Shell (computing)}}

{{More citations needed|date=August 2011}}

{{Use dmy dates|date=May 2019|cs1-dates=y}}

File:Bash screenshot.png commands and resulting output.]]

This article catalogs comparable aspects of notable operating system shells.

General characteristics

{{sticky header}}

{{sort-under}}

class="wikitable sortable sticky-header sort-under" style="width: auto; text-align: center; font-size: smaller;"
Shell

!{{small|Usual
environment}}

!{{small|Usually
invoked}}

!{{small|Introduced}}

!{{small|Platform-independent}}

!{{small|Default login shell in}}

!{{small|Default script shell in}}

!{{small|License}}

!{{small|Source code availability}}

!{{small|User
interface}}

!{{small|Mouse
support}}

!{{small|Unicode
support}}

!{{small|ISO 8601
support}}

!{{small|Console redirection}}

!{{small|Stream redirection}}

!{{small|Configurability}}

!{{small|Startup/shutdown scripts}}

!{{small|Batch scripts}}

!{{small|Logging}}

!{{small|Available as statically linked, independent single file executable}}

Thompson shell

|UNIX

|sh

|1971

|{{N/A}}

|UNIX

|UNIX

|{{N/A}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{no}}

|{{N/A}}

|{{yes}}

|{{N/A}}

|{{N/A}}

|{{N/A}}

|{{N/A}}

|{{N/A}}

|{{N/A}}

Bourne shell 1977 version

|7th Ed. UNIX

|sh

|1977

|{{yes|YesA [http://www.collyer.net/who/geoff/v7sh.tar platform independent version] based on the historical UNIX V7 original source code is available from [http://www.collyer.net/who/geoff/ Geoff Collyer]}}

|7th Ed. UNIX

|7th Ed. UNIX,

|{{proprietary|ProprietaryThe historic UNIX V7 version is available under [http://minnie.tuhs.org/Archive/Caldera-license.pdf a BSD-style license] through The Unix Heritage Society and others.}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{no}}

|{{N/A}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|.profile}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{no}}

|{{yes}}

Bourne shell current version

|Various UNIX

|sh

|1977

|{{yes|YesA [https://sourceforge.net/projects/schilytools/files/ platform independent version] based on the SVr4/Solaris source code is available from Jörg Schilling}}

|SunOS-5.x, FreeBSD{{citation |url=https://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-users/index.html |chapter-url=https://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-users/shells.html |title=FreeBSD Quickstart Guide for Linux Users |chapter=Chapter 2. Default Shell |author-first=John |author-last=Ferrell |publisher=The FreeBSD Documentation Project |access-date=2015-07-24}}

|SunOS-5.x

|{{free|CDDL{{cite web |url=https://sourceforge.net/p/schillix-on/schillix-on/ci/default/tree/usr/src/cmd/sh/ |title=SchilliX-ON / SchilliX-ON Mercurial / [b1d9a2] /usr/src/cmd/sh |publisher=Sourceforge.net |access-date=2015-07-02}}{{better source needed|date=April 2015}}}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{yes}}Since mid 1990s.{{better source needed|date=April 2015}}

|{{N/A}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|.profile}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}if compiled with -DACCT.

|{{yes}}

POSIX shell{{cite book |author=IEEE and The Open Group |title=IEEE 1003.1 Standard for Information Technology – Portable Operating System Interface (POSIX): Shell and Utilities, Issue 7 |date=2008}}

|POSIX

|sh

|1992As part of IEEE Std.1003.2-1992 (POSIX.2); integrated into IEEE Std.1003.1 with the 2001 revision.

|{{N/A}}

|{{N/A}}

|POSIX

|{{N/A}}

|{{N/A}}

|Text-based CLI

|{{no}}

|{{yes}}
{{small|if used by configured locale}}

|{{N/A}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{small|Unspecified
({{mono|.profile}} given as an example)

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{N/A}}

bash (v4)

|POSIX

|bash, sh

|1989{{Cite newsgroup

|title=Bash is in beta release!

|author-first=Brian

|author-last=Fox

|editor-first=Leonard H.

|editor-last=Tower Jr.

|date=1989-06-07

|newsgroup=gnu.announce

|message-id=8906080235.AA01983@wheat-chex.ai.mit.edu

|url=https://groups.google.com/group/gnu.announce/msg/a509f48ffb298c35?hl=en

|access-date=2010-10-28}}

|{{yes}}

|GNU, Linux (default for root), macOS 10.3–10.14

|GNU, Linux, Haiku, macOS 10.3–10.14

|{{free|GPL}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{yes}}{{citation |chapter-url=http://tldp.org/LDP/abs/html/bashver4.html |title=Advanced Bash-Scripting Guide |chapter=Chapter 37.3.2. Bash, version 4.2 |author-first=Mendel |author-last=Cooper |publisher=The Linux Documentation Project |access-date=2015-04-30}}, "Bash now supports the \u and \U Unicode escape."{{better source needed|reason=Unicode escape is just a small part of Unicode support. There's also editing and string handling. This works in bash 4.3.33, but needs a source.|date=May 2015}}

|{{yes}}
{{small|({{mono|printf}} builtin)}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|/etc/profile}}, {{mono|.bash_profile}}, {{mono|.bash_login}}, {{mono|.profile}}, {{mono|.bashrc}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

csh

|POSIX

|csh

|1978

|{{yes}}

|SunOS

|{{dunno}}

|{{free|BSD}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{no}}

|{{dunno}}

|{{yes}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|~/.cshrc}}, {{mono|~/.login}}, {{mono|~/.logout}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

tcsh

|POSIX

|tcsh, csh

|1983{{Cite newsgroup

|author-first=Ken

|author-last=Greer

|title=C shell with command and filename recognition/completion

|date=1983-10-03

|newsgroup=net.sources

|url=https://groups.google.com/group/net.sources/msg/7073bf41cc5da330?hl=en

|access-date=2010-12-29}}

|{{yes}}

|FreeBSD (former default for root),{{Cite web |title=FreeBSD Quickstart Guide for Linux® Users |url=https://docs.freebsd.org/en/articles/linux-users/ |access-date=2024-02-04 |website=FreeBSD Documentation Portal |language=en}} formerly Mac OS X

|{{dunno}}

|{{free|BSD}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{yes}}

|{{dunno}}

|{{yes}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|/etc/csh.cshrc}}, {{mono|/etc/csh.login}}, {{mono|~/.tcshrc}}, {{mono|~/.cshrc}}, {{mono|~/.history}}, {{mono|~/.login}}, {{mono|~/.cshdirs}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

Hamilton C shell

|Win32, OS/2

|csh

|1988{{cite journal

|author-last=Sussman

|author-first=Ann

|title=Hamilton C Shell Speeds Development Of OS/2 Applications

|journal=PC Week

|date=1988-12-26

|issue=1988-12-26 - 1989-01-02

|page=37

|url=https://hamiltonlabs.com/archives/Hamilton-C-Shell-Speeds-Development-of-OS-2-Applications-Ann-Sussman-PC-Week-Dec-26-1988.pdf

|access-date=2010-11-22}}

|{{yes}}
{{small|(OS/2 version no longer maintained)}}

|{{optional}}

|{{optional}}

|{{proprietary}}

|{{no}}

|Text-based CLI

|{{no}}

|{{no}}

|{{yes}}
{{small|(-t timestamp operator)}}

|{{yes}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|(via login.csh, startup.csh and logout.csh)}}

|{{yes}}
{{small|(command line option)}}

|{{yes}}

|{{yes}}

Scsh

|POSIX

|scsh

|1994

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{free|BSD-style}}

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{yes}}

ksh (ksh93t+)

|POSIX

|ksh

|1983{{Cite newsgroup

|author-first=Ron

|author-last=Gomes

|title=Toronto USENIX Conference Schedule (tentative)

|date=1983-06-09

|newsgroup=net.usenix

|url=https://groups.google.com/group/net.usenix/msg/fa6e1f7de3b63bba?hl=en

|access-date=2010-12-29}}

{{Cite newsgroup

|author-first=Guy

|author-last=Harris

|title=csh question

|date=1983-10-10

|newsgroup=net.flame

|url=https://groups.google.com/group/net.flame/msg/4f868085b65af530?hl=en

|access-date=2010-12-29}}

|{{yes}}

|AIX, HP-UX

|OpenSolaris

|{{free|Common Public License}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|printf}} builtin with {{mono|%(%F)T}}[https://docs.oracle.com/cd/E36784_01/html/E36870/ksh-1.html ksh93(1) man page])}}

|{{yes}}

|{{yes}}
{{small|({{mono|fds}} up to 9)}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|(system and user's {{mono|profile}} and {{mono|kshrc}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

pdksh

|POSIX

|ksh, sh

|1989?

|{{yes}}

|OpenBSD[http://www.openbsd.org/faq/faq10.html#rootshell Default shell in OpenBSD] is ksh (pdksh).

|OpenBSD

|{{free|Public domain}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{no}}

|{{N/A}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|/etc/profile}}, {{mono|.profile}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

zsh

|POSIX

|zsh

|1990

|{{yes}}

|Deepin, GoboLinux, Grml, macOS 10.15+, Kali 2020.4+

|Grml, macOS 10.15+

|{{free|MIT-style}}

|{{yes}}

|Text-based CLI

|{{yes}}
{{small|via additional codeThe zsh command line editor is fully configurable and can allow mouse support in various ways such as with [http://stchaz.free.fr/mouse.zsh Stéphane Chazelas's {{mono|mouse.zsh}}].}}

|{{yes}}

|{{yes}}
{{small|(various internal features involving the date, by using the {{mono|%F}} {{mono|strftime}} format[http://linux.die.net/man/1/zsh zsh(1) man page and subpages] and the {{mono

i}} option for the {{mono|fc}} builtin[http://linux.die.net/man/1/zshbuiltins zshbuiltins(1) man page])}}

|{{yes}}

|{{yes}}
{{small|({{mono|fds}} up to 9){{cite mailing list |url=https://www.zsh.org/mla/users/2015/msg00211.html |title=multi-digit file descriptors |date=2015-02-11 |access-date=2021-12-23 |mailing-list=zsh-users |last=Lefevre |first=Vincent}}}}

|{{yes}}
{{small|(via variables, options, functions, styles, etc.)}}

|{{yes}}
{{small|(system and user's {{mono|zshenv}}, {{mono|zprofile}}, {{mono|zshrc}}, {{mono|zlogin}}, {{mono|zlogout}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

ash

|POSIX

|sh

|1989

|{{yes}}

|Minix, BusyBox based systems

|NetBSD, Minix, BusyBox based systems

|{{free|BSD-style}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{partial}}
{{small|(for BusyBox, supported in command-line editing, but not in string handling{{cite web |url=https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782228 |title=#782228 - busybox sh doesn't support multibyte characters in string handling - Debian Bug report logs |publisher=Bugs.debian.org |date=2015-04-09 |access-date=2015-07-02}})}}

|{{N/A}}

|{{yes}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|({{mono|/etc/profile}}, {{mono|.profile}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}

|{{yes}}

CCP

|CP/M, MP/M

|(CCP)

|1976 (1974)

|{{no}}

|CP/M (no login), MP/M

|CP/M, MP/M

|{{proprietary|Freeware (originally proprietary)}}

|{{yes}} (originally closed-source)

|Text-based CLI

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}} (automatic via {{mono|$$$.SUB}})

|{{partial}}
{{small|(only via external {{mono|SUBMIT}} command to update {{mono|$$$.SUB}})}}

|{{no}}

|{{yes}}

COMMAND.COM

|DOS

|COMMAND

|1980

|{{no}}
{{small|(3rd party implementations, not bound to a specific DOS vendor or version, available)}}

|DOS, Windows 95, 98, SE, ME

|DOS, Windows 95, 98, SE, ME

|vendor specific, f.e. MS-EULA,MS-DOS and Windows component – covered by a valid license for MS-DOS or Microsoft Windows. or BSD/GPL (free clones)

|{{no}} (except for OpenDOS, DR-DOS, PTS/DOS and FreeDOS)

|Text-based CLI

|{{no}}

|{{no}}

|{{no}} (except for DR-DOS)

|{{yes}} (via {{mono|COMMAND con:}} or {{mono|CTTY con:}})

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}})}}

|{{yes}} (via startup parameters and environment variables, DR-DOS also supports {{mono|DIR /C /R}} user-default switch command)

|{{yes}} (automatic {{mono|\AUTOEXEC.BAT}} for primary shell, or explicitly via {{mono|/P}}, {{mono|/P:filename.bat}} or {{mono|/K}} startup options)

|{{yes}} (via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)

|{{no}}

|{{yes}}

OS/2 CMD.EXE

|OS/2, eComStation, ArcaOS

|CMD

|1987

|{{no}}

|OS/2, eComStation, ArcaOS

|OS/2, eComStation, ArcaOS

|{{proprietary|IBM-EULA}}OS/2 component – covered by a valid license for OS/2.

|{{no}}

|Text-based CLI

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stderr}})}}

|{{dunno}}

|{{partial}} (only via {{mono|/K}} startup option)

|{{yes}} (via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)

|{{no}}

|{{yes}}

Windows CMD.EXECommand extensions enabled, or "CMD /X".

|Win32

|CMD

|1993

|{{no}}

|Windows NT, 2000, XP, Server 2003, Vista

|Windows NT, 2000, XP, Server 2003, Vista

|{{proprietary|MS-EULA}}Windows component – covered by a valid license for Microsoft Windows.

|{{no}}

|Text-based CLI

|{{no}}

|{{partial}} ({{mono|CHCP 65001}} for UTF-8, but program arguments are still encoded in local codepage)

|{{no}}

|{{no}}

|{{yes}}

|{{yes}} (via registry, startup parameters, and environment variables)

|{{yes}} (automatic via registry, or explicitly via {{mono|/K}} startup option)

|{{yes}} (via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)

|{{no}}

|{{yes}}

4DOS, NDOS

|DOS, Windows 95, 98, SE, ME

|4DOS, NDOS

|1989 (1986)

|{{no}}
{{small|(not bound to a specific OS vendor or version)}}

|{{optional}}

|{{optional}}

|{{free|MIT License, with restrictions}}

|{{yes}}

|Text-based CLI with TUI extensions

|{{yes}} (popups, help system, {{mono|%_MOUSE}} internal variable, {{mono|INKEY /M}} command)

|{{no}}

|{{yes}}

|{{yes}} (via {{mono|CTTY con:}}, except for {{mono|DRAWBOX}}, {{mono|DRAWLINE}}, {{mono|DRAWVLINE}}, {{mono|LIST}}, {{mono|SCREEN}}, {{mono|SCRPUT}}, {{mono|SELECT}}, {{mono|VSCRPUT}} commands and file / directory coloring)

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stderr}}, {{mono|stdout+stderr}})}}

|{{yes}} (via {{mono|4DOS.INI}}/{{mono|NDOS.INI}} file, startup parameters, environment variables, {{mono|SETDOS}} command)

|{{yes}} (automatic {{mono|\AUTOEXEC.BAT}} for primary shell and {{mono|4START.BTM}}/{{mono|4START.BAT}} as well as {{mono|4EXIT.BTM}}/{{mono|4EXIT.BAT}} for any shell, or explicitly via {{mono|/P}}, {{mono|/P:dir\filename.ext}} or {{mono|/K}} startup options)

|{{yes}} (via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)

|{{yes}}

|{{yes}}

4OS2

|OS/2, eComStation, ArcaOS

|4OS2

|1992

|{{no}}
{{small|(not bound to specific OS/2 versions)}}

|{{optional}} (but bundled with ArcaOS)

|{{optional}}

|{{proprietary|Freeware}}

|{{yes}}

|Text-based CLI

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stderr}}, {{mono|stdout+stderr}})}}

|{{yes}} (via {{mono|4OS2.INI}} file, startup parameters, environment variables, {{mono|SETDOS}} command)

|{{yes}} (automatic via {{mono|4START.CMD}}/{{mono|4START.BTM}} as well as {{mono|4EXIT.CMD}}/{{mono|4EXIT.BTM}} files, or explicitly via {{mono|/K startup.cmd}} option)

|{{yes}} (via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)

|{{yes}}

|{{dunno}}

TCC
(formerly 4NT)

|Win32

|TCC

|1993

|{{no}}
{{small|(not bound to specific NT versions)}}

|optional

|optional

|{{proprietary|Shareware}}

|{{no}}

|Text-based CLI (Take Command: GUI)

|{{yes}}
{{small|(console mouse, popups, help system, {{mono|%_XMOUSE}}, {{mono|%_YMOUSE}} internal variables, {{mono|INKEY /M}} command)}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stderr}}, {{mono|stdout+stderr}})}}

|{{yes}}
{{small|(via registry, {{mono|TCMD.INI}}/{{mono|4NT.INI}} file, startup parameters, environment variables, {{mono|SETDOS}} command)}}

|{{yes}}
{{small|(automatic via registry and {{mono|TCSTART}}/{{mono|4START}} as well as {{mono|TCEXIT}}/{{mono|4EXIT}}, or explicitly via {{mono|/K}} startup option)}}

|{{yes}}
{{small|(via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)}}

|{{yes}}

|{{no}}

VMS DCL{{cite web

|url=http://h71000.www7.hp.com/doc/732final/9996/9996pro_contents.html

|title=HP OpenVMS DCL Dictionary

|access-date=2009-03-23

|archive-url=https://web.archive.org/web/20070325041517/http://h71000.www7.hp.com/doc/732FINAL/9996/9996pro_contents.html

|archive-date=25 March 2007

|url-status=dead

}}

|OpenVMS

|{{small|Automatically for login/interactive process}}

|1977?

|{{yes}}

|VMS

|VMS

|Proprietary, bundled in VMS

|{{no|by special license only}}

|Text-based CLI

|{{yes|with DECwindows/Motif}}

|{{yes}}

|{{yes|Yes, at least to 1988 standard}}

|{{yes}}

|{{yes}}
{{small|({{mono|sys$input}}, {{mono|sys$output}} assignment)}}

|{{yes}}
{{small|(via symbols, logical names, and options)}}

|{{yes}}
{{small|(SYS$MANAGER:SYLOGIN.COM and user defined LOGIN.COM)}}

|{{yes}}

|{{yes}}

|{{no}}

PowerShell

||.NET,
.NET Framework

|PowerShell

|2006

|{{yes}}

|Windows 10, 8, Server 2008, 7Microsoft PowerShell is installed by default on Windows 7 and later. It is an optional download for users of Windows Vista or Windows XP.

|Windows 10, 8, Server 2008, 7

|{{free|MIT-style}}

|{{yes}}

|Graphical CLI

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}
{{small|(via variables and options)}}

|{{yes}}
{{small|(%USERPROFILE%\Documents \WindowsPowerShell\Microsoft.PowerShell_profile.ps1)}}

|{{yes}}
{{small|(PowerShell feature)}}

|{{yes}}

|{{no}}

rc

|Plan 9, POSIX

|rc

|1989

|{{yes}}

|Plan 9, Version 10 Unix

|Plan 9, Version 10 Unix

|{{free|MIT License{{cite web

|url=https://www.phoronix.com/scan.php?page=news_item&px=Plan-9-2021

|title=Plan 9 Copyright Transferred To Foundation, MIT Licensed Code Released

|last=Larabel

|first=Michael

|date=2021-03-23

|website=Phoronix

|access-date=2021-03-28}}}}

|{{yes}}

|Text-based CLI

|{{dunno}}

|{{yes}}

|{{yes}}

|{{dunno}}

|{{yes}}

|{{yes}}
{{small|(via options)}}

|{{yes}}
{{small|({{mono|$HOME/.rcrc}})}}

|{{yes}}

|{{dunno}}

|{{yes}}

BeanShell

|Java

|{{dunno}}

|2005

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{free|LGPL}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{dunno}}

|{{no}}

fish

|POSIX

|fish

|2005{{cite web

|title=Fish - The friendly interactive shell

|author-first=Axel

|author-last=Liljencrantz

|date=2005-05-17

|url=https://lwn.net/Articles/136232/

|access-date=2013-04-08}}

|{{yes}}

|GhostBSD

|{{dunno}}

|{{free|GPL}}

|{{yes}}

|Text-based CLI

|{{dunno}}

|{{yes}}

|{{dunno}}

|{{dunno}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(through environment variables and via web interface through {{mono|fish_config}})}}

|{{yes}}
{{small|({{mono|/etc/fish/config.fish}} and {{mono|~/.config/fish/config.fish}})}}

|{{yes}}
{{small|(Unix feature)}}

|{{yes}}
{{small|({{mono|~/.config/fish/fish_history*}})}}

|{{dunno}}

Ion

|Redox, Linux

|ion

|2015{{cite web

|title=d79c8f511573fb7710abc63b4236a40022914520

|author-first=Jeremy

|author-last=Soller

|date=2015-11-15

|url=https://gitlab.redox-os.org/redox-os/ion/commit/d79c8f511573fb7710abc63b4236a40022914520

|access-date=2019-08-03}}

|{{yes}}

|Redox

|Redox

|{{free|MIT}}

|{{yes}}

|Text-based CLI

|{{dunno}}

|{{yes}}

|{{yes}}

|{{dunno}}

|{{yes}}
{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}}

|{{yes}}
{{small|(follows the XDG Base Directory spec)}}

|{{yes}}
{{small|({{mono|~/.config/ion/initrc}})}}

|{{yes|Yes}}

|{{yes}}
{{small|({{mono|~/.local/share/ion/history}})}}

|{{partial}} (not distributed as a standalone executable, but it can be built as one)

Shell

!Usual environment

!Usually invoked

!Introduced

!Platform-independent

!Default login shell in

!Default script shell in

!License

!Source code availability

!User interface

!Mouse support

!Unicode support

!ISO 8601 support

!Console redirection

!Stream redirection

!Configurability

!Startup/shutdown scripts

!Batch scripts

!Logging

!Available as statically linked, independent single file executable

Interactive features

{{sticky header}}

{{sort-under}}

class="wikitable sortable sort-under sticky-header" style="width: auto; text-align: center; font-size: smaller;"
Shell

!{{small|Command
name
completion
}}

!{{small|Path
completion
}}

!{{small|Command
argument
completion
}}

!{{small|Wildcard
completion
}}

!{{small|Command
history
}}

!{{small|Mandatory
argument
prompt
}}

!{{small|Automatic
suggestions
}}

!{{small|Colored
directory
listings
}}

!{{small|Text
highlighting
}}

!{{small|Syntax
highlighting
}}

!{{small|Directory history, stack or similar features}}

!{{small|Implicit
directory
change
}}

!{{small|Auto­correction}}

!{{small|Integrated
environment}}

!{{small|Snippets}}

!{{small|Value
prompt}}

!{{small|Menu/options
prompt}}

!{{small|Progress
indicator
}}

!{{small|Context
sensitive
help
}}

Thompson shell

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

Bourne shell 1977 version

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

Bourne shell current version

|{{no}}

|{{yes}}current versions from Jörg Schilling.

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}} (CDPATH, pushd, popd, dirs), CDPATH since SVr4

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

POSIX shell

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|CDPATH}})}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

bash (v4.0)

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}Alt-Shift-8 or Alt-* will expand to the full matching list of filenames.

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|CDPATH}}, {{mono|pushd}}, {{mono|popd}})}}

|{{yes|optional}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{partial|External}}

|{{no}}

csh

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|cdpath}}, {{mono|pushd}}, {{mono|popd}})}}

|{{yes|optional}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

tcsh

|{{yes}}

|{{yes}}

|{{yes2|when defined}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|cdpath}}, {{mono|pushd}}, {{mono|popd}})}}

|{{yes|optional}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

Hamilton C shell

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|cdpath}}, {{mono|pushd}}, {{mono|popd}})}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

Scsh

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{partial|External}}

|{{no}}

ksh (ksh93t+)

|{{yes}}
{{small|(extendable)}}

|{{yes}}
{{small|(extendable)}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|({{mono|cdpath}} builtin, {{mono|pushd}}, {{mono|popd}} implemented as functions)}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{partial|External}}

|{{no}}

pdksh

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{partial|External}}

|{{no}}

zsh

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}{{cite web |title=[Z Shell] Completion System |url=https://zsh.sourceforge.io/Doc/Release/Completion-System.html |publisher=Zsh.sourceforge.io |access-date=2015-02-24}}

|{{yes}}

|{{yes}}This applies only on reserved words and other syntactic features.

|{{yes}}
{{small|(via {{mono|predict-on}} or user-definede.g. via 3rd party such as [https://github.com/tarruda/zsh-autosuggestions zsh-autosuggestions])}}

|{{yes}}

|{{yes}}

|{{partial|Third-party extension}}zsh does not feature syntax highlighting, but a 3rd party project exists which offers this capability as an add-on: [https://github.com/zsh-users/zsh-syntax-highlighting zsh-syntax-highlighting]

|{{yes}}

|{{yes|optional}}

|{{yes}}

|{{no}}

|{{yes2|when defined (as ZLE widgets)}}

|{{yes}}

|{{yes}}

|{{partial|External}}

|{{yes}}

ash

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{partial|External}}

|{{no}}

CCP

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

COMMAND.COM

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}Available through the {{mono|DOSKEY}} add-on.Available in DR-DOS through {{mono|HISTORY}}.

|{{no}}

|{{no}}

|{{no}}

|{{no}} (only in DR-DOS through %$ON%, %$OFF%, %$HEADER%, %$FOOTER%)

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}} (only single-stepping with COMMAND /Y)

|{{no}}

|{{no}}

|{{no}} (only via external {{mono|CHOICE}} command, in DR-DOS also via {{mono|SWITCH}} / {{mono|DRSWITCH}} internal commands)

|{{no}}

|{{no}}

OS/2
CMD.EXE

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

Windows
CMD.EXE

|{{yes2|partial}}

|{{yes2|partial}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|F8}})}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|PUSHD}}, {{mono|POPD}})}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}} (via {{mono|SET /P}} command)

|{{no}}

|{{no}}

|{{no}}

4DOS

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}Alternatively available through the {{mono|DOSKEY}} add-on as well.Alternatively available in DR-DOS through {{mono|HISTORY}} as well.

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes| (via popup, extended directory searches, {{mono|CDPATH}}, {{mono|PUSHD}}, {{mono|POPD}}, {{mono|DIRHISTORY}}, {{mono|DIRS}}, {{mono|CDD}}, {{mono|CD -}} commands and {{mono|%@DIRSTACK[]}} function)}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes}} (via {{mono|INPUT}}, {{mono|INKEY}} and {{mono|ESET}} commands)

|{{yes}} (via {{mono|@SELECT[]}} function, and indirectly via a combination of {{mono|INKEY}}, {{mono|INPUT}}, {{mono|SWITCH}} commands)

|{{no}}

|{{yes}}

4OS2

|?

|?

|?

|?

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|?

|{{no}}

|?

|?

|{{no}}

|{{yes}}

TCC (formerly 4NT)

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes| (via popup, extended directory searches, {{mono|CDPATH}}, {{mono|PUSHD}}, {{mono|POPD}}, {{mono|DIRHISTORY}}, {{mono|DIRS}}, {{mono|CDD}}, {{mono|CD -}} commands and {{mono|%@DIRSTACK[]}} function)}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes}} (via {{mono|INPUT}}, {{mono|INKEY}}, {{mono|ESET}} and {{mono|SET /P}} commands)

|{{yes}} (via {{mono|@SELECT[]}} function, and indirectly via a combination of {{mono|INKEY}}, {{mono|INPUT}}, {{mono|SWITCH}} commands)TCC has special prompt functions for Yes, No, Cancel, Close, Retry.

|{{no}}

|{{yes}}

PowerShell

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}
{{small|({{mono|F8}})}}

|{{yes}}

|{{yes|Yes; via PSReadLine{{cite web |url=https://github.com/lzybkr/PSReadLine|title=PSReadLine: A bash inspired readline implementation for PowerShell|first=Jason|last=Shirk|date=15 February 2018|via=GitHub}} module (bundled in v5.0{{Cite web |url=https://msdn.microsoft.com/en-us/powershell/scripting/core-powershell/core-modules/windows-powershell-5.0 |title=Windows PowerShell 5.0 |access-date=8 September 2016 |archive-url=https://web.archive.org/web/20160917093943/https://msdn.microsoft.com/en-us/powershell/scripting/core-powershell/core-modules/windows-powershell-5.0 |archive-date=17 September 2016 |url-status=dead |df=dmy-all }}) or in ISE}}

|{{partial|Third-party extension}}{{Cite web|url=https://github.com/joonro/Get-ChildItemColor|title = Get-ChildItemColor|website = GitHub|date = 18 March 2022}}

|{{yes}}{{Cite web

| title = Write-Host (Microsoft.PowerShell.Utility) - PowerShell

| author = sdwheeler

| work = docs.microsoft.com

| date =

| access-date = 18 January 2022

| url = https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-host

| quote =

}}

|{{yes|Yes; via PSReadLine module (bundled in v5.0) or in ISE}}

|{{yes}}
{{small|(multiple stacks; multiple location types;[https://technet.microsoft.com/en-us/library/hh849855.aspx Push-Location] (with alias pushd) and [https://technet.microsoft.com/en-us/library/hh849842.aspx Pop-Location] (with alias popd) allows multiple location types (directories of file systems, organizational units of Active Directory, nodes of Windows Registry etc) to be pushed onto and popped from location stacks. {{mono|Push-Location}}, {{mono|Pop-Location}})}}

|{{yes2}}Yes, in PSReadLine module

|{{yes2}}Yes, in ISE{{cite web |title=Windows PowerShell Integrated Scripting Environment (ISE) |url=https://technet.microsoft.com/en-us/library/dd819514.aspx?f=255&MSPPError=-2147217396 |publisher=Microsoft Technet |access-date=2015-09-12}}

|{{yes2}}Yes, in ISE

|{{yes}}

|{{yes}}The [https://technet.microsoft.com/en-us/library/ff730939.aspx $host.ui.PromptForChoice] function allows for a menu-style prompt for choices. The prompt works from background jobs as well as from remote sessions, displaying the menu prompt on the console of the controlling session.

|{{yes}}The [https://technet.microsoft.com/en-us/library/hh849902.aspx {{mono|Write-Progress}}] cmdlet writes a progress bar which can indicate percentage, remaining seconds etc. The progress bar messages work from background jobs or remote sessions in addition to interactive scripts, i.e. the progress bar is displayed on the console of the controlling session, not as part of the regular output.

|{{yes}}, in ISE

|{{yes|popup window}}The [https://technet.microsoft.com/en-us/library/hh849915.aspx {{mono|Show-Command}}] cmdlet inspects the command definition and opens an interactive windows with a named input field for each parameter/switch

rc

|{{yes}}Handled by rio, GNU readline, editline or vrl.

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|?

|{{no}}

|{{no}}

|{{no}}

BeanShell

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

VMS DCL

|{{yes|Minimum uniqueness scheme}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

fish

|{{yes}}

|{{yes}}

|{{yes}}{{cite web |url=http://fishshell.com/docs/current/index.html#completion |title=fish: Documentation |at=Section Tab completion |access-date=2016-01-10}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}

|{{yes}}
{{small|(built-in helper available{{Cite web|title=set_color - set the terminal color — fish-shell 3.1.2 documentation|url=https://fishshell.com/docs/current/cmds/set_color.html|url-status=live|access-date=2021-02-23|website=fishshell.com|archive-url=https://web.archive.org/web/20200217185759/http://fishshell.com:80/docs/current/cmds/set_color.html |archive-date=17 February 2020 }})}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}The fish shell is an interactive character based input/output surface.

|{{yes| Yes, using {{mono|abbr}} command}}

|{{yes}}

|{{yes| (via {{mono|fish_config}} command{{Cite web|title=abbr - manage fish abbreviations — fish-shell 3.1.2 documentation|url=https://fishshell.com/docs/current/cmds/abbr.html|access-date=2021-02-23|website=fishshell.com}})}}

|{{no}}

|{{no}}

Shell

!Command
name
completion

!Path
completion

!Command
argument
completion

!Wildcard
completion

!Command
history

!Mandatory
argument
prompt

!Automatic
suggestions

!Colored
directory
listings

!Text
highlighting

!Syntax
highlighting

!Directory history, stack or similar features

!Implicit
directory
change

!Auto­correction

!Integrated
environment

!Snippets

!Value
prompt

!Menu/options
prompt

!Progress
indicator

!Context
sensitive
help

= Background execution =

Background execution allows a shell to run a command without user interaction in the terminal, freeing the command line for additional work with the shell. POSIX shells and other Unix shells allow background execution by using the & character at the end of command.

= Completions =

{{main article|Command-line completion}}

Image:Command-line-completion-example.gif.]]Completion features assist the user in typing commands at the command line, by looking for and suggesting matching words for incomplete ones. Completion is generally requested by pressing the completion key (often the {{keypress|TAB}} key).

Command name completion is the completion of the name of a command. In most shells, a command can be a program in the command path (usually $PATH), a builtin command, a function or alias.

Path completion is the completion of the path to a file, relative or absolute.

Wildcard completion is a generalization of path completion, where an expression matches any number of files, using any supported syntax for file matching.

Variable completion is the completion of the name of a variable name (environment variable or shell variable).

Bash, zsh, and fish have completion for all variable names. PowerShell has completions for environment variable names, shell variable names and — from within user-defined functions — parameter names.

Command argument completion is the completion of a specific command's arguments. There are two types of arguments, named and positional: Named arguments, often called options, are identified by their name or letter preceding a value, whereas positional arguments consist only of the value. Some shells allow completion of argument names, but few support completing values.

Bash, zsh and fish offer parameter name completion through a definition external to the command, distributed in a separate completion definition file. For command parameter name/value completions, these shells assume path/filename completion if no completion is defined for the command. Completion can be set up to dynamically suggest completions by calling a shell function.{{cite web |url=https://zsh.sourceforge.io/Doc/Release/Completion-System.html |title=zsh: 20. Completion System |publisher=Zsh.sourceforge.io |date=2013-03-06 |access-date=2013-08-18}} The fish shell additionally supports parsing of man pages to extract parameter information that can be used to improve completions/suggestions. In PowerShell, all types of commands (cmdlets, functions, script files) inherently expose data about the names, types and valid value ranges/lists for each argument. This metadata is used by PowerShell to automatically support argument name and value completion for built-in commands/functions, user-defined commands/functions as well as for script files. Individual cmdlets can also define dynamic completion of argument values where the completion values are computed dynamically on the running system.

= Command history =

{{main article|Command history}}

Users of a shell may find themselves typing something similar to what they have typed before. Support for command history means that a user can recall a previous command into the command-line editor and edit it before issuing the potentially modified command.

Shells that support completion may also be able to directly complete the command from the command history given a partial/initial part of the previous command.

Most modern shells support command history. Shells which support command history in general also support completion from history rather than just recalling commands from the history. In addition to the plain command text, PowerShell also records execution start- and end time and execution status in the command history.

= Mandatory argument prompt =

{{further|Named parameter#Optional parameters}}

Mandatory arguments/parameters are arguments/parameters which must be assigned a value upon invocation of the command, function or script file. A shell that can determine ahead of invocation that there are missing mandatory values, can assist the interactive user by prompting for those values instead of letting the command fail. Having the shell prompt for missing values will allow the author of a script, command or function to mark a parameter as mandatory instead of creating script code to either prompt for the missing values (after determining that it is being run interactively) or fail with a message.

= Automatic suggestions =

{{main article|Autocomplete}}

Image:Powershell Intellisense example for the Get-Process cmdlet.gif.]]Shells featuring automatic suggestions display optional command-line completions as the user types. The PowerShell and fish shells natively support this feature; pressing the {{keypress|tab}} key inserts the completion.

Implementations of this feature can differ between shells; for example, PowerShell{{Cite web|last=sdwheeler|title=What's New in the PowerShell 5.0 ISE - PowerShell|url=https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/whats-new/what-s-new-in-the-powershell-50-ise|access-date=2021-07-25|website=docs.microsoft.com|language=en-us}} and zsh{{Cite web|title=GitHub - marlonrichert/zsh-autocomplete: 🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.|url=https://github.com/marlonrichert/zsh-autocomplete|access-date=2021-07-25|website=GitHub|language=en}} use an external module to provide completions, and fish derives its completions from the user's command history.{{Cite web|title=Interactive use — fish-shell 3.3.1 documentation|url=https://fishshell.com/docs/current/interactive.html#autosuggestions|access-date=2021-07-25|website=fishshell.com}}

= Directory history, stack or similar features =

{{Further|pushd and popd}}

Shells may record a history of directories the user has been in and allow for fast switching to any recorded location. This is referred to as a "directory stack". The concept had been realized as early as 1978{{Cite book|last=Hahn|first=Harley|url=https://www.worldcat.org/oclc/184828059|title=Harley Hahn's guide to Unix and Linux|date=2009|publisher=McGraw-Hill Higher Education|isbn=978-0-07-313361-4|location=Boston|oclc=184828059}} in the release of the C shell (csh).

Command line interpreters 4DOS and its graphical successor Take Command Console also feature a directory stack.

= Implicit directory change =

A directory name can be used directly as a command which implicitly changes the current location to the directory.

This must be distinguished from an unrelated load drive feature supported by Concurrent DOS, Multiuser DOS, System Manager and REAL/32, where the drive letter L: will be implicitly updated to point to the load path of a loaded application, thereby allowing applications to refer to files residing in their load directory under a standardized drive letter instead of under an absolute path.{{cite book |title=Concurrent DOS 386 - Multiuser/Multitasking Operating System - User Guide |publisher=Digital Research |url=http://bitsavers.org/pdf/digitalResearch/concurrent/1126-2004-001_Concurrent_DOS_386_Users_Guide_Nov87.pdf}}

= Autocorrection =

File:Zsh autocompletion and autocorrection demo.gif program.]]

When a command line does not match a command or arguments directly, spell checking can automatically correct common typing mistakes (such as case sensitivity, missing letters). There are two approaches to this; the shell can either suggest probable corrections upon command invocation, or this can happen earlier as part of a completion or autosuggestion.

The tcsh and zsh shells feature optional spell checking/correction, upon command invocation.

Fish does the autocorrection upon completion and autosuggestion. The feature is therefore not in the way when typing out the whole command and pressing enter, whereas extensive use of the tab and right-arrow keys makes the shell mostly case insensitive.

The PSReadLine PowerShell module (which is shipped with version 5.0) provides the option to specify a CommandValidationHandler ScriptBlock which runs before submitting the command. This allows for custom correcting of commonly mistyped commands, and verification before actually running the command.

= Progress indicator =

A shell script (or job) can report progress of long running tasks to the interactive user.

Unix/Linux systems may offer other tools support using progress indicators from scripts or as standalone-commands, such as the program "pv".{{cite web |url=http://linux.die.net/man/1/pv |title=pv(1): monitor progress of data through pipe - Linux man page |publisher=Linux.die.net |access-date=2015-02-24}} These are not integrated features of the shells, however.

= Colored directory listings =

JP Software command-line processors provide user-configurable colorization of file and directory names in directory listings based on their file extension and/or attributes through an optionally defined {{code|%COLORDIR%}} environment variable.

For the Unix/Linux shells, this is a feature of the {{mono|ls}} command and the terminal.

= Text highlighting =

The command line processors in DOS Plus, Multiuser DOS, REAL/32 and in all versions of DR-DOS support a number of optional environment variables to define escape sequences allowing to control text highlighting, reversion or colorization for display or print purposes in commands like TYPE. All mentioned command line processors support %$ON% and %$OFF%. If defined, these sequences will be emitted before and after filenames. A typical sequence for {{code|%$ON%}} would be {{code|\033[1m}} in conjunction with ANSI.SYS, {{code|\033p}} for an ASCII terminal or {{code|\016}} for an IBM or ESC/P printer. Likewise, typical sequences for {{code|%$OFF%}} would be {{code|\033[0m}}, {{code|\033q}}, {{code|\024}}, respectively. The variables %$HEADER% and %$FOOTER% are only supported by COMMAND.COM in DR-DOS 7.02 and higher to define sequences emitted before and after text blocks in order to control text highlighting, pagination or other formatting options.

For the Unix/Linux shells, this is a feature of the terminal.

= Syntax highlighting =

{{main article|Syntax highlighting}}

A defining feature of the fish shell is built-in syntax highlighting, As the user types, text is colored to represent whether the input is a valid command or not (the executable exists and the user has permissions to run it), and valid file paths are underlined.{{Cite web |title=fish: Tutorial |url=https://fishshell.com/docs/3.0/tutorial.html#tut_syntax_highlighting |access-date=2022-10-21 |website=fishshell.com}}

An independent project offers syntax highlighting as an add-on to the Z Shell (zsh).{{cite web |url=https://github.com/zsh-users/zsh-syntax-highlighting |title=zsh-users/zsh-syntax-highlighting: Fish shell like syntax highlighting for Zsh |website=GitHub |access-date=2013-08-18}} This is not part of the shell, however.

PowerShell provides customizable syntax highlighting on the command line through the PSReadLine module. This module can be used with PowerShell v3.0+, and is bundled with v5.0 onwards. It is loaded by default in the command line host "powershell.exe" since v5.0.{{Cite web |last=sdwheeler |title=PSReadLine Module - PowerShell |url=https://learn.microsoft.com/en-us/powershell/module/psreadline/ |access-date=2023-04-26 |website=learn.microsoft.com |language=en-us}}

Take Command Console (TCC) offers syntax highlighting in the integrated environment.

=Context sensitive help=

{{main article|Context-sensitive help}}

4DOS, 4OS2, 4NT / Take Command Console and PowerShell (in PowerShell ISE) looks up context-sensitive help information when {{keypress|F1}} is pressed.

Zsh provides various forms of configurable context-sensitive help as part of its {{mono|run-help}} widget, {{mono|_complete_help}} command, or in the completion of options for some commands.

The fish shell provides brief descriptions of a command's flags during tab completion.

Programming features

{{sort-under}}

class="wikitable sortable sort-under" style="width: auto; text-align: center; font-size: smaller;"
Shell

!Functions

!Exception handling

!Search & replace
on variable substi­tutions

!{{verth|Arithmetic}}

!{{verth|Floating point}}

!Math function library

!Linear arrays or lists

!{{verth|Assoc­iative
arrays
}}

!{{verth|Lambda
functions
}}

!{{verth|eval
function
}}

!Pseudo­random number generation

!Bytecode

Bourne shell 1977 version

|{{no}}

|{{yes| Yes (via {{mono|trap}})}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

Bourne shell current version

|{{yes| Yes since SVR2}}

|{{yes| Yes (via {{mono|trap}})}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

POSIX shell

|{{yes}}

|{{yes| Yes (via {{mono|trap}})}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

bash (v4.0)

|{{yes}}

|{{yes| Yes (via {{mono|trap}})}}

|{{yes}}
{{small|(via {{mono|${//}}} syntax)}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|$RANDOM}}) }}

|{{no}}

csh

|{{no}}

|{{no}}

|{{yes}}
{{small|(via {{mono|$var:s///}} syntax)}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

tcsh

|{{partial|Work in progress[https://github.com/tcsh-org/tcsh/pull/77 Introduce 'function' built-in] by Matheus Garcia}}

|{{no}}

|{{yes}}
{{small|(via {{mono|$var:s///}} syntax)}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

Hamilton C shell

|{{yes}}

|{{no}}

|{{yes}}
{{small|(via {{mono|$var:s///}} syntax)}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes| Yes (random utility)}}

|{{no}}

Scsh

|{{yes}}

|?

|{{yes}}
{{small|(via string functions and regular expressions)}}

|?

|?

|?

|{{yes}}

|?

|{{yes}}

|{{yes}}

|{{yes}}
{{small|(random-integer, random-real)}}

|{{yes}}
{{small|(compiler is Scheme48 virtual machine, via {{mono|scshvm}})}}

ksh (ksh93t+)

|{{yes}}

|{{yes| Yes (via {{mono|trap}})}}

|{{yes}}
{{small|(via {{mono|${//}}} syntax and builtin commands)}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|$RANDOM}})}}

|{{yes}}
{{small|(compiler is called {{mono|shcomp}})}}

pdksh

|{{yes}}

|{{yes| Yes (via {{mono|trap}})}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|$RANDOM}})}}

|{{no}}

zsh

|{{yes}}

|{{yes}}

|{{yes}}
{{small|(via {{mono|${:s//}}} and {{mono|${//}}} syntax)}}

|{{yes}}

|{{yes}}

|{{yes}}
{{small|({{mono|zsh/mathfunc}} module)}}

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|$RANDOM}})}}

|{{yes}}
{{small|(built-in {{mono|zcompile}} command)}}

ash

|{{yes}}

|{{yes}} (via {{mono|trap}})

|{{no}}

|{{yes}}
{{small|(since 1992){{Cite web |url=http://www.in-ulm.de/~mascheck/various/ash/ |title=Ash Variants |access-date=15 December 2014 |archive-url=https://web.archive.org/web/20100310193527/http://www.in-ulm.de/~mascheck/various/ash/ |archive-date=10 March 2010 |url-status=dead }}}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

CCP

|{{no}}

|?

|{{no}}

|{{no}}

|?

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

COMMAND.COM

|{{no}}

|{{partial}} (only Auto-fail (via {{mono|COMMAND /F}} (or {{mono|/N}} in some versions of DR-DOS))

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

OS/2 CMD.EXE

|{{no}}

|{{no}}

|{{no}}

|?

|{{no}}

|{{no}}

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

Windows CMD.EXE

|{{yes}}
{{small|(via {{mono|CALL :label}})}}

|{{no}}

|{{yes}}
{{small|(via {{mono|SET %varname:expression}} syntax)}}

|{{yes}}
{{small|(via {{mono|SET /A}}){{cite web |url=https://ss64.com/nt/set.html |title=Set - Environment Variable - Windows CMD |publisher=SS64.com |access-date=2015-02-24}}}}

|{{no}}

|{{no}}

|{{yes}}
{{small|(via {{mono|SET}}{{cite web |url=https://stackoverflow.com/questions/18462169/how-to-loop-through-array-in-batch |title=How to loop through array in batch? |publisher=Stack Overflow |access-date=2015-02-24}})}}

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|%random%}})}}

|{{no}}

4DOS

|{{yes}}

|{{yes}}
{{small|(via {{mono|ON}} command, optional Auto-fail via {{mono|4DOS /F}})}}

|{{yes}}
{{small|(via {{mono|%@Replace[...]}} function)}}

|{{yes}}
{{small|(via {{mono|SET /A}})}}

|?

|?

|{{yes}}
{{small|(via ranges, include lists, {{mono|@}}file lists and {{mono|FOR}} command)}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|%@Random[...]}} function)}}

|{{yes}}
{{small|(via {{mono|BATCOMP}} command)}}

4OS2

|?

|?

|?

|?

|?

|?

|?

|?

|{{no}}

|{{yes}}

|{{yes}} ({{mono|%@Random[...]}} function)

|?

TCC (formerly 4NT)

|{{yes}}

|{{yes}}
{{small|(via {{mono|ON}} and various {{mono|...MONITOR}} commands)}}

|{{yes}}
{{small|(via {{mono|%@Replace[...]}} function)}}

|{{yes}}
{{small|(via {{mono|SET /A}})}}

|?

|?

|{{yes}}
{{small|(via ranges, include lists, {{mono|@}}file lists and {{mono|FOR}} command)}}

|?

|{{no}}

|{{yes}}

|{{yes}} ({{mono|%@Random[...]}} function)

|{{yes}} (via {{mono|BATCOMP}} command)

PowerShell

|{{yes}}

|{{yes}} (Try-Catch-Finally)

|{{yes}}
{{small|({{mono

replace}} operator)}}

|{{yes}}

|{{yes}}

|{{yes|[Math] class}}The .NET System.Math class defines mathematical functions that can be used through the shortcut {{mono|[Math]}}, e.g. {{mono|[Math]::Sin}} for the sinus function.[https://technet.microsoft.com/en-us/library/dd347632.aspx]

|{{yes}}

|{{yes}}

|{{yes}}{{cite web |url=https://devblogs.microsoft.com/powershell/get-closure-with-getnewclosure/ |title=Get closure with GetNewClosure |date=2009-03-27 |website=devblogs.microsoft.com |access-date=2022-09-12}}

|{{yes}}

|{{yes}}

|{{yes|Yes, automatic}}

rc

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|?

|?

|{{yes}}

|?

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

BeanShell

|{{yes}}

|{{yes}}

|?

|{{yes}}

|?

|?

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}

|{{yes}}

VMS DCL

|{{yes}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes|yes, for compiled programs}}

|{{yes}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

fish

|{{yes}}

|{{yes| Yes (via {{mono|trap}})}}

|{{yes|Yes, via {{mono|string}} builtin command{{Cite web|title=string - manipulate strings — fish-shell 3.1.2 documentation|url=https://fishshell.com/docs/current/cmds/string.html|access-date=2021-02-23|website=fishshell.com}}}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|random}})}}

|{{no}}

String processing and filename matching

{{sort-under}}

class="wikitable sortable sort-under" style="width: auto; text-align: center; font-size: smaller;"
Shell

!String processing

!Alternation (Brace expansion)

!Pattern matching (regular expressions built-in)

!Pattern matching (filename globbing)

!Globbing qualifiers (filename generation based on file attributes)

!Recursive globbing (generating files from any level of subdirectories)

Bourne shell 1977 version

|?

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}}

|{{no}}

|{{no}}

Bourne shell recent version

|{{partial}} (prefix and suffix stripping in variable expansion)

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}}

|{{no}}

|{{no}}

POSIX shell

|{{partial}} (prefix and suffix stripping in variable expansion)

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}}

|{{no}}

|{{no}}

bash (v4.0)

|{{partial}} (prefix and suffix stripping in variable expansion)

|{{yes}}

|{{yes}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, {{mono|{...}}})}}

|{{no}}

|{{yes}} ({{mono|**/...}})

csh

|{{yes}}
{{small|(:s and other editing operators)}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

tcsh

|{{yes}}
{{small|(:s and other editing operators)}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

Hamilton C shell

|{{yes}}
{{small|(:s and other editing operators + substr, strlen, strindex, printf, reverse, upper, lower, concat and other builtin functions)}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|(via indefinite directory {{mono|"..."}} wildcard{{Citation

|url=https://hamiltonlabs.com/UserGuide/31-Wildcarding.htm

|title=Hamilton C shell Language reference: Wildcarding and pattern matching

|access-date=2013-10-29

|publisher=Hamilton Laboratories

|quote={{mono|...}} Indefinite Directory: match any number of directory levels – zero or more – whatever it takes to make the rest of the pattern match.}})}}

Scsh

|?

|?

|{{yes}}

|{{yes}}

|{{no}}

|{{no}}

ksh (ksh93t+)

|{{partial}} (prefix, suffix stripping and string replacement in variable expansion)

|{{yes}}{{cite book

|author-last1=Seebach

|author-first1=Peter

|title=Beginning Portable Shell Scripting: From Novice to Professional

|url=https://books.google.com/books?id=53zaxy423xcC

|series=Expert's voice in open source

|date=21 November 2008

|publisher=Apress

|publication-date=2008

|page=149

|isbn=9781430210436

|access-date=2014-09-17

|quote=Brace expansion is available in ksh93, pdksh, bash, and zsh.}}

|{{yes}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}}

|{{no}}

|{{yes}} (with {{mono|set -G}}, no following of symlinks)

pdksh

|?

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

zsh

|{{yes}} (through variable processing: e.g. substring extraction, various transformations via parameter expansion)

|{{yes}}

|{{yes}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, extended globbingZsh offers a variety of [https://zsh.sourceforge.io/Guide/zshguide05.html#l135 globbing options].)}}

|{{yes}}

|{{yes}} ({{mono|**/...}} or {{mono|***/...}} to follow symlinks)

ash

|?

|?

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

CCP

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

COMMAND.COM

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}})}}

|{{no}}

|{{no}}

OS/2 CMD.EXE

|{{no}}

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}})}}

|{{partial}} (only in {{mono|DIR /A:...}} command)

|{{no}}

Windows CMD.EXE

|{{partial}} (only through {{mono|FOR /F}} and {{mono|SET /A}})

|{{no}}

|{{no|NoNot available as a shell built-in. External {{mono|FINDSTR /R}} command is available in most Windows releases.}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}})}}

|{{partial}} (only in {{mono|DIR /A:...}} command)

|{{yes}} (via {{mono|FOR /R}} command, or, where available, indirectly via {{mono|/S}} subdir option)

4DOS

|{{yes}} (through variable functions {{mono|%@...[]}}, extended environment variable processing, various string commands and {{mono|FOR /F}} and {{mono|SET /A}})

|{{no}}

|{{no}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, extended wildcards, {{mono|SELECT}} popup command)}}

|{{yes}} (via {{mono|/A:...}} attribute and {{mono|/I"..."}} description options and {{mono|/[S...]}} size, {{mono|/[T...]}} time, {{mono|/[D...]}} date, and {{mono|/[!...]}} file exclusion ranges)

|{{yes}} (via {{mono|FOR /R}} command, or indirectly via {{mono|GLOBAL}} command or, where available, {{mono|/S}} subdir option)

4OS2

|?

|{{no}}

|{{no}}

|?

|?

|?

TCC (formerly 4NT)

|{{yes}} (through variable functions {{mono|%@...[]}}, extended environment variable processing, various string commands and {{mono|FOR /F}} and {{mono|SET /A}})

|{{no}}

|{{yes}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, extended wildcards, {{mono|SELECT}} popup command)}}

|{{yes}} (via {{mono|/A:...}} attribute and {{mono|/I"..."}} description options and {{mono|/[S...]}} size, {{mono|/[T...]}} time, {{mono|/[D...]}} date, {{mono|/[O...]}} owner, and {{mono|/[!...]}} file exclusion ranges)

|{{yes}} (via {{mono|FOR /R}} command, or indirectly via {{mono|GLOBAL}} command or, where available, {{mono|/S}} subdir option)

PowerShell

|{{yes}}
{{small|(Concat/Substring/Insert/Remove/Replace, ToLower/ToUpper, Trim/TrimStart/TrimEnd, Compare, Contains/StartsWith/EndWith, Format, IndexOf/LastIndexOf, Pad/PadLeft/PadRight, Split/Join, regular expression functions and other .NET string functions)}}

|{{partial|Range operator for numbers{{Cite web

| title = about Operators - PowerShell

| author = sdwheeler

| work = docs.microsoft.com

| date =

| access-date = 18 January 2022

| url = https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators

| quote =

}}}}

|{{yes}}
{{small|(full regex support)PowerShell leverages the full .NET regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}}

|?

|?

rc

|?

|?

|{{no}}

|{{yes}}

|{{no}}

|{{no}}

BeanShell

|?

|?

|{{yes}}

|?

|?

|?

VMS DCL

|{{yes}}

|{{no}}

|{{no}}

|{{yes}}

|{{no}}

|{{yes}} (via {{mono|[SUBDIR...]}})

fish

|{{yes}}
{{small|(builtin string function)}}

|{{yes|Yes}}

|{{yes}}
{{small|(via builtin {{mono|string match}} and {{mono|string replace}} functions)}}

|{{yes}}
{{small|({{mono|*}}, {{mono|?}}, {{mono|{...}}})}}

|{{no}}

|{{yes}} ({{mono|**/...}})

Inter-process communication

class="wikitable sortable" style="width: auto; text-align: center; font-size: smaller;"
Shell

!Pipes

!Command substitution

!Process substitution

!Subshells

!TCP/UDP connections as streams

!Keystroke stacking

Bourne shell

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}xautomation and xdotool can be used to generate keystrokes under X Window System; or a program can be run in a pseudoterminal to be able to control it (as with the {{mono|expect}} tool).

POSIX shell

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}

bash (v4.0)

|{{yes|bytes concurrent}}

|{{yes}}

|{{yes}}
{{small|(if system supports {{mono|/dev/fd/{{angbr|n}}}} or named pipes)}}

|{{yes}}

|{{yes}}
{{small|(client only)}}

|{{N/A|N/A}}

csh

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}

tcsh

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}

Hamilton C shell

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|?

Scsh

|{{yes|text}}

|?

|?

|?

|{{yes}}

|{{N/A|N/A}}

ksh (ksh93t+)

|{{yes|bytes (may contain serialized objects if {{mono|print -C}} is used) concurrent}}

|{{yes}}
{{small|({{mono|$(...)}} and {{mono|${...;}}})}}

|{{yes}}
{{small|(if system supports {{mono|/dev/fd/{{angbr|n}}}})}}

|{{yes}}

|{{yes}}
{{small|(and SCTP support, client only)}}

|{{N/A|N/A}}

pdksh

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}

zsh

|{{yes|bytes concurrent}}

|{{yes}}

|{{yes}}

|{{yes}}

|{{yes}}
{{small|(client and server, but only TCP)}}

|{{N/A|N/A}}

ash

|{{yes|bytes concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{no}}

|{{N/A|N/A}}

CCP

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

COMMAND.COM

|{{yes|text sequential temporary files}}

|{{no}}

|{{no}}

|{{partial}} (only under DR-DOS multitasker via {{mono|COMMAND.COM /T}})

|{{no}}

|{{no}}

OS/2 CMD.EXE

|{{yes|text concurrent}}

|{{no}}

|{{no}}

|?

|{{no}}

|{{no}}

Windows CMD.EXE

|{{yes|text concurrent}}

|{{yes}}
{{small|(via {{mono|FOR /F}} command)}}

|{{no}}

|{{yes}}
{{small|(Backtick: {{mono|`}} in {{mono|FOR /F usebackq}})}}

|{{no}}

|{{no}}

4DOS

|{{yes|text sequential temporary files}}

|{{yes}}
{{small|(via {{mono|FOR /F}} command)}}

|?

|{{partial}} (via {{mono|%@EXECSTR[]}} and {{mono|%@EXEC[]}}, or via {{mono|SET /M}}, {{mono|ESET /M}} and {{mono|UNSET /M}} and {{mono|%@MASTER[...]}})

|{{no}}

|{{yes}} (via {{mono|KEYSTACK}} and {{mono|KSTACK}}){{cite book |title=4DOS 8.00 online help |title-link=4DOS 8.00 |author-first1=Hardin |author-last1=Brothers |author-first2=Tom |author-last2=Rawson |author-link2=Tom Rawson |author-first3=Rex C. |author-last3=Conn |author-link3=Rex C. Conn |author-first4=Matthias R. |author-last4=Paul |author-first5=Charles E. |author-last5=Dye |author-first6=Luchezar I. |author-last6=Georgiev |date=2002-02-27}}

4OS2

|{{yes|text concurrent}}

|?

|?

|?

|{{no}}

|{{yes}} (via {{mono|KEYSTACK}})

TCC (formerly 4NT)

|{{yes|text concurrent}}

|{{yes}}
{{small|(via {{mono|FOR /F}} command)}}

|?

|{{partial}} (via {{mono|%@EXECSTR[]}} and {{mono|%@EXEC[]}})

|{{yes}} (via {{mono|FTP}}, {{mono|TFTP}}, {{mono|FTPS}}, {{mono|SFTP}}, {{mono|HTTP}}, {{mono|HTTPS}} and {{mono|IFTP}}, client only)

|{{yes}} (via {{mono|KEYSTACK}})

PowerShell

|{{yes|objects concurrent}}

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}

|?

rc

|{{yes|text concurrent}}

|{{yes}}

|{{yes}}
{{small|(via: {{mono|<{cmd}}} if system supports {{mono|/dev/fd/{{angbr|n}}}})}}

|{{yes}}

|{{no}}

|?

BeanShell

|{{no|not supported}}

|?

|?

|?

|{{yes}}

|?

VMS DCL

|{{yes|text (via {{mono|PIPE}} command)}}

|{{yes}}

|{{no}}

|{{yes}}
{{small|(spawn)}}

|{{yes}}
{{small|(server TCP only)}}

|{{no}}

fish

|{{yes|bytes concurrent}}

|{{yes}} ({{mono|...}})

|{{No|No (broken){{cite web|url=https://github.com/fish-shell/fish-shell/issues/1040|title=find a way to make 'psub --fifo' safe from deadlock · Issue #1040 · fish-shell/fish-shell|website=GitHub}}}}

|{{no}}

|{{no}}

|{{N/A|N/A}}

=Keystroke stacking=

In anticipation of what a given running application may accept as keyboard input, the user of the shell instructs the shell to generate a sequence of simulated keystrokes, which the application will interpret as a keyboard input from an interactive user. By sending keystroke sequences the user may be able to direct the application to perform actions that would be impossible to achieve through input redirection or would otherwise require an interactive user. For example, if an application acts on keystrokes, which cannot be redirected, distinguishes between normal and extended keys, flushes the queue before accepting new input on startup or under certain conditions, or because it does not read through standard input at all. Keystroke stacking typically also provides means to control the timing of simulated keys being sent or to delay new keys until the queue was flushed etc. It also allows to simulate keys which are not present on a keyboard (because the corresponding keys do not physically exist or because a different keyboard layout is being used) and therefore would be impossible to type by a user.

Security features

{{importance section|date=July 2014}}

{{sort-under}}

class="wikitable sortable sort-under" style="width: auto; text-align: center; font-size: smaller;"
Shell

!Secure (password) prompt

!File/directory passwords

!Execute permission

!Restricted shell subset

!Safe data subset

Bourne shell

|{{some|via {{mono|stty}}}}The shell can use the {{mono|stty}} utility to suppress echoing of typed characters to the screen. This requires multiple steps: 1. reading the current echo state, 2. switching echo off, 3. reading the input, 4. switching echo state back to the original state.

|?

|{{N/A|N/A}}The execute permission is enforced by a separate program, the program loader, by refusing to invoke the interpreter (possibly a shell) specified by the script's hashbang. The interpreter does not enforce the execute permission if invoked directly as the program loader would, with the file as an argument; this only requires read permission, as does piping the file as input to the interpreter, in which case the interpreter cannot see the execute permission.

|{{yes}}

|{{no}}

POSIX shell

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{no}}

|{{no}}

bash (v4.0)

|{{yes|{{mono|read -s}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

csh

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

tcsh

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

Hamilton C shell

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

Scsh

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{no}}

|{{no}}

ksh (ksh93t+)

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

pdksh

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

zsh

|{{yes|{{mono|read -s}}}}

|?

|{{N/A|N/A}}The zsh and fish shells also honor the execute permission for command completion.

|{{yes}}

|{{no}}

ash

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}

|{{no}}

CCP

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

COMMAND.COM

|{{partial}} (only under DR-DOS, prompts for password if file/directory is protected)

|{{partial}} (only under DR-DOS via {{mono|\dirname;dirpwd\filename;filepwd}} syntax)Under DR-DOS the password separator for file and directory passwords is a semicolon. This is also supported under 4DOS for as long as the command does not support include lists. Under 4DOS, the password separator must be doubled for all commands supporting include lists in order to distinguish passwords from include lists. Commands not supporting include lists accept both forms. DR-DOS 7.02 and higher optionally accept a doubled semicolon as well, so that doubled semicolons work under both COMMAND.COM and 4DOS regardless of the command executed.

|{{partial}} (only under DR-DOS, if files are password-protected for read and/or execute permission)DR-DOS supports file passwords for read/write/delete and optionally execute permissions. Files are not protected by default, but the system can be set up so that f.e. batch scripts require a password to read.

|{{no}}

|{{no}}

OS/2 CMD.EXE

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

Windows CMD.EXE

|{{no}}

|{{no}}

|{{no}}

|{{no}}

|{{no}}

4DOS

|{{yes}} (via {{mono|INPUT /P}} or {{mono|INKEY /P}}){{mono|INPUT /P}} and {{mono|INKEY /P}} echoes back asterisks for each typed character.

|{{partial}} (only under DR-DOS via {{mono|\dirname;;dirpwd\filename;;filepwd}} syntax)

|{{partial}} (only under DR-DOS, if files are password-protected for read and/or execute permission)

|{{no}}

|{{no}}

4OS2

|?

|{{no}}

|{{no}}

|{{no}}

|{{no}}

TCC (formerly 4NT)

|{{yes}} (via {{mono|INPUT /P}}, {{mono|INKEY /P}} or {{mono|QUERYBOX /P}})

|{{no}}

|{{no}}

|{{no}}

|{{no}}

PowerShell

|{{yes}}{{mono|Read-Host -AsSecureString}} reads a string of characters from the input device into an encrypted string, one character at a time thus ensuring that there is no memory image of the clear text which could be gleaned from scanning memory, or from crash dumps, memory dumps, paging files, log files or similar.

|{{no}}

|{{no}}PowerShell script files ({{mono|.ps1}} files) are by default associated with the Notepad editor, not with the PowerShell execution engine. Invoking a {{mono|.ps1}} file will launch Notepad rather than executing the script.

|{{yes}}Startup scripts per computer/user can import modules and expose a subset the commands/functions available in the modules.

|{{yes}}{{cite web |url=https://technet.microsoft.com/en-us/library/hh848302.aspx |title=About Data Sections |publisher=Technet.microsoft.com |access-date=2015-02-24}}

rc

|{{some|via {{mono|stty}}}}

|?

|{{N/A|N/A}}

|{{yes}}{{cite web |url=http://manpages.ubuntu.com/manpages/precise/man1/rc.1.html |title=Ubuntu Manpage: rc - shell |publisher=Manpages.ubuntu.com |date=2003-07-17 |access-date=2015-02-24}}

|{{no}}

BeanShell

|?

|?

|?

|?

|?

VMS DCL

|{{yes}}

|{{no}}

|{{yes}}

|{{yes}}

|{{no}}

fish

|{{yes|{{mono|read -s}}}}

|?

|{{N/A|N/A}}

|{{yes| Yes (via {{mono|fish -l}})}}

|?

= Secure prompt =

Some shell scripts need to query the user for sensitive information such as passwords, private digital keys, PIN codes or other confidential information. Sensitive input should not be echoed back to the screen/input device where it could be gleaned by unauthorized persons. Plaintext memory representation of sensitive information should also be avoided as it could allow the information to be compromised, e.g., through swap files, core dumps etc.{{cite web |author-last=Provos |author-first=Niels |title=Encrypting Virtual Memory |url=http://www.openbsd.org/papers/swapencrypt.ps |publisher=Center for Information Technology Integration, University of Michigan |access-date=2012-12-20}}

The shells bash, zsh and PowerShell offer this as a specific feature.{{cite web |url=https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html |title=bash - GNU Bourne-Again SHell |quote=read -s Silent mode. If input is coming from a terminal, characters are not echoed.}}{{cite web |url=https://technet.microsoft.com/en-us/library/ee176935.aspx |title=Using the Read-Host Cmdlet |quote=By adding the -assecurestring parameter you can mask the data entered at the prompt}} Shells which do not offer this as a specific feature may still be able to turn off echoing through some other means. Shells executing on a Unix/Linux operating system can use the {{mono|stty}} external command to switch off/on echoing of input characters.{{cite web |title=Linux / Unix Command: stty |url=http://linux.about.com/od/commands/l/blcmdl1_stty.htm |publisher=Linux.about.com |access-date=2015-02-24 |archive-date=2015-02-25 |archive-url=https://web.archive.org/web/20150225005431/http://linux.about.com/od/commands/l/blcmdl1_stty.htm |url-status=dead }} In addition to not echoing back the characters, PowerShell's {{code|-AsSecureString}} option also encrypts the input character-by-character during the input process, ensuring that the string is never represented unencrypted in memory where it could be compromised through memory dumps, scanning, transcription etc.

= Execute permission =

Some operating systems define an execute permission which can be granted to users/groups for a file when the file system itself supports it.

On Unix systems, the execute permission controls access to invoking the file as a program, and applies both to executables and scripts.

As the permission is enforced in the program loader, no obligation is needed from the invoking program, nor the invoked program, in enforcing the execute permission{{Snd}} this also goes for shells and other interpreter programs.

The behaviour is mandated by the POSIX C library that is used for interfacing with the kernel. POSIX specifies that the exec family of functions shall fail with EACCESS (permission denied) if the file denies execution permission (see {{man|sh|execve|SUS}}).

The execute permission only applies when the script is run directly. If a script is invoked as an argument to the interpreting shell, it will be executed regardless of whether the user holds the execute permission for that script.

Although Windows also specifies an execute permission, none of the Windows-specific shells block script execution if the permission has not been granted.

= Restricted shell subset =

Several shells can be started or be configured to start in a mode where only a limited set of commands and actions is available to the user. While not a security boundary (the command accessing a resource is blocked rather than the resource) this is nevertheless typically used to restrict users' actions before logging in.

A restricted mode is part of the POSIX specification for shells, and most of the Linux/Unix shells support such a mode where several of the built-in commands are disabled and only external commands from a certain directory can be invoked.{{cite web |url=http://pwet.fr/man/linux/commandes/posix/sh |title=man sh - shell, the standard command language interpreter / posix |language=fr |publisher=Pwet.fr |access-date=2013-08-18 |archive-url=https://web.archive.org/web/20141221210713/http://pwet.fr/man/linux/commandes/posix/sh |archive-date=21 December 2014 |url-status=dead }}{{cite web |url=https://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell.html |title=Bash Reference Manual: The Restricted Shell |publisher=Gnu.org |date=2010-12-28 |access-date=2013-08-18}}

PowerShell supports restricted modes through session configuration files or session configurations. A session configuration file can define visible (available) cmdlets, aliases, functions, path providers and more.{{cite web |url=https://technet.microsoft.com/en-us/library/hh849712.aspx |title=New-PSSessionConfigurationFile |publisher=Technet.microsoft.com |access-date=2013-08-18}}

= Safe data subset =

Scripts that invoke other scripts can be a security risk as they can potentially execute foreign code in the context of the user who launched the initial script. Scripts will usually be designed to exclusively include scripts from known safe locations; but in some instances, e.g. when offering the user a way to configure the environment or loading localized messages, the script may need to include other scripts/files.{{cite book |author-last1=Albing |author-first1=Carl |title=Bash cookbook |year=2007 |publisher=O'Reilly Media |location=Sebastopol, California, USA |isbn=978-0-596-52678-8 |edition=1st |author-last2=Vossen |author-first2=J. P. |author-last3=Newham |author-first3=Cameron |quote=[...] is hardly what one thinks of as a passive list of configured variables. It can run other commands (e.g., cat) and use if statements to vary its choices. It even ends by echoing a message. Be careful when you source something, as it's a wide open door into your script.}} One way to address this risk is for the shell to offer a safe subset of commands which can be executed by an included script.

Notes

{{Reflist|group="nb"}}

References

{{Reflist|refs=

{{cite web |author-first=Matthias R. |author-last=Paul |title=Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM - README.TXT and BOOT.TXT - A short description of how OpenDOS is booted |url=http://www.uni-bonn.de/~uzs180/download/ibmbioa3.zip |date=1997-10-02 |orig-year=1997-09-29 |access-date=2009-03-29 |url-status=dead |archive-url=https://web.archive.org/web/20031004074600/http://www-student.informatik.uni-bonn.de/~frinke/ibmbioa3.zip |archive-date=2003-10-04}} [https://web.archive.org/web/20181225154705/http://mirror.macintosharchive.org/max1zzz.co.uk/+Windows%20&%20DOS/DOS/System/Novell/Support/Bins/Op702src.zip]

}}