Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Comparison of command shells
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{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|250px|thumb|Screen shot of a terminal showing various [[Bash (Unix shell)|Bash]] commands and resulting output.]] This article catalogs comparable aspects of notable [[operating system]] [[shell (computing)|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<br>environment}} !{{small|Usually<br>invoked}} !{{small|Introduced}} !{{small|[[Cross-platform|Platform-independent]]}} !{{small|Default login shell in}} !{{small|Default script shell in}} !{{small|License}} !{{small|Source code availability}} !{{small|User<br>interface}} !{{small|Mouse<br>support}} !{{small|[[Unicode]]<br>support}} !{{small|[[ISO 8601]]<br>support}} !{{small|[[Console redirection]]}} !{{small|[[Standard streams|Stream]] [[Redirection (computing)|redirection]]}} !{{small|Configurability}}<!-- yes/no/which, persistent via config files, registry, temporary via env vars, startup scripts - might require a table of its own --> !{{small|Startup/shutdown scripts}} !{{small|Batch scripts}} !{{small|Logging}}<!-- - might require a table of its own --> !{{small|Available as statically linked, independent single file executable}} |- ![[Thompson shell]] |[[Unix|UNIX]] |sh |1971 |{{N/A}} |[[Unix|UNIX]] |[[Unix|UNIX]] |{{N/A}} |{{yes}} |Text-based [[Command-line interface|CLI]] |{{no}} |{{no}} |{{N/A}} |{{yes}} |{{N/A}} |{{N/A}} |{{N/A}} |{{N/A}} |{{N/A}} |{{N/A}} |- ![[Bourne shell]] 1977 version |[[Version 7 Unix|7th Ed. UNIX]] |sh |1977 |{{yes|Yes<ref>A [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]</ref>}} |[[Version 7 Unix|7th Ed. UNIX]] |[[Version 7 Unix|7th Ed. UNIX]], |{{proprietary|Proprietary<ref>The 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.</ref>}} |{{yes}} |Text-based [[Command-line interface|CLI]] |{{no}} |{{no}} |{{N/A}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|[[file descriptor|fd]]s}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|.profile}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{no}} |{{yes}} |- ![[Bourne shell]] current version |Various [[Unix|UNIX]] |sh |1977 |{{yes|Yes<ref>A [https://sourceforge.net/projects/schilytools/files/ platform independent version] based on the SVr4/Solaris source code is available from Jörg Schilling</ref>}} |SunOS-5.x, FreeBSD<ref>{{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}}</ref> |SunOS-5.x |{{free|[[Common Development and Distribution License|CDDL]]<ref>{{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}}</ref>{{better source needed|date=April 2015}}}} |{{yes}} |Text-based [[Command-line interface|CLI]] |{{no}} |{{yes}}<ref group="nb">Since mid 1990s.</ref>{{better source needed|date=April 2015}} |{{N/A}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|.profile}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}}<ref group="nb">if compiled with -DACCT.</ref> |{{yes}} |- ![[POSIX]] shell<ref>{{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}}</ref> |[[POSIX]] |sh |1992<ref>As part of IEEE Std.1003.2-1992 (POSIX.2); integrated into IEEE Std.1003.1 with the 2001 revision.</ref> |{{N/A}} |{{N/A}} |[[POSIX]] |{{N/A}} |{{N/A}} |Text-based CLI |{{no}} |{{yes}}<br>{{small|if used by configured locale}} |{{N/A}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{small|Unspecified<br>({{mono|.profile}} given as an example) |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{N/A}} |- ![[Bash (Unix shell)|bash]] (v4) |[[POSIX]] |bash, sh |1989<ref>{{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}}</ref> |{{yes}} |[[GNU]], [[Linux]] (default for root), [[macOS]] 10.3–10.14 |[[GNU]], [[Linux]], [[Haiku (operating system)|Haiku]], [[macOS]] 10.3–10.14 |{{free|[[GPL]]}} |{{yes}} |Text-based CLI |{{no}} |{{yes}}<ref>{{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."</ref>{{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}}<br>{{small|({{mono|printf}} builtin)}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|/etc/profile}}, {{mono|.bash_profile}}, {{mono|.bash_login}}, {{mono|.profile}}, {{mono|.bashrc}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[C shell|csh]] |[[POSIX]] |csh |1978 |{{yes}} |[[SunOS]] |{{dunno}} |{{free|[[BSD licenses|BSD]]}} |{{yes}} |Text-based CLI |{{no}} |{{no}} |{{dunno}} |{{yes}} |{{yes}}<br>{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|~/.cshrc}}, {{mono|~/.login}}, {{mono|~/.logout}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[tcsh]] |[[POSIX]] |tcsh, csh |1983<ref name="Greer">{{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}}</ref> |{{yes}} |[[FreeBSD]] (former default for root),<ref>{{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}}</ref> formerly [[Mac OS X]] |{{dunno}} |{{free|[[BSD licenses|BSD]]}} |{{yes}} |Text-based CLI |{{no}} |{{yes}} |{{dunno}} |{{yes}} |{{yes}}<br>{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|/etc/csh.cshrc}}, {{mono|/etc/csh.login}}, {{mono|~/.tcshrc}}, {{mono|~/.cshrc}}, {{mono|~/.history}}, {{mono|~/.login}}, {{mono|~/.cshdirs}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[Hamilton C shell]] |[[Win32]], OS/2 |csh |1988<ref name="PCWeek">{{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}}</ref> |{{yes}}<br>{{small|(OS/2 version no longer maintained)}} |{{optional}} |{{optional}} |{{proprietary}} |{{no}} |Text-based CLI |{{no}} |{{no}} |{{yes}}<br>{{small|(-t timestamp operator)}} |{{yes}} |{{yes}}<br>{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stdout+stderr}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|(via login.csh, startup.csh and logout.csh)}} |{{yes}}<br>{{small|(command line option)}} |{{yes}} |{{yes}} |- ![[Scsh]] |[[POSIX]] |scsh |1994 |{{yes}} |{{dunno}} |{{dunno}} |{{free|[[BSD licenses|BSD]]-style}} |{{yes}} |{{dunno}} |{{dunno}} |{{dunno}} |{{dunno}} |{{dunno}} |{{yes}} |{{dunno}} |{{dunno}} |{{dunno}} |{{dunno}} |{{yes}} |- ![[Korn Shell|ksh]] (ksh93t+) |[[POSIX]] |ksh |1983<ref name="Gomes">{{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}}</ref><ref name="Harris"> {{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}}</ref> |{{yes}} |[[AIX]], [[HP-UX]] |[[OpenSolaris]] |{{free|[[Common Public License]]}} |{{yes}} |Text-based CLI |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|printf}} builtin with {{mono|%(%F)T}}<ref name="ksh93-man-page">[https://docs.oracle.com/cd/E36784_01/html/E36870/ksh-1.html ksh93(1) man page]</ref>)}} |{{yes}} |{{yes}}<br>{{small|({{mono|fds}} up to 9)<ref name="ksh93-man-page"/>}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|(system and user's {{mono|profile}} and {{mono|kshrc}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[pdksh]] |[[POSIX]] |ksh, sh |1989? |{{yes}} |[[OpenBSD]]<ref name="default OpenBSD">[http://www.openbsd.org/faq/faq10.html#rootshell Default shell in OpenBSD] is ksh (pdksh).</ref> |[[OpenBSD]]<ref name="default OpenBSD"/> |{{free|[[Public domain]]}} |{{yes}} |Text-based CLI |{{no}} |{{no}} |{{N/A}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|/etc/profile}}, {{mono|.profile}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[zsh]] |[[POSIX]] |zsh |1990 |{{yes}} |[[Deepin]], [[GoboLinux]], [[Grml]], [[macOS]] 10.15+, [[Kali Linux|Kali]] 2020.4+ |[[Grml]], [[macOS]] 10.15+ |{{free|[[MIT license|MIT]]-style}} |{{yes}} |Text-based CLI |{{yes}}<br>{{small|via additional code<ref>The 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}}].</ref>}} |{{yes}} |{{yes}}<br>{{small|(various internal features involving the date, by using the {{mono|%F}} {{mono|strftime}} format<ref>[http://linux.die.net/man/1/zsh zsh(1) man page and subpages]</ref> and the {{mono|-i}} option for the {{mono|fc}} builtin<ref>[http://linux.die.net/man/1/zshbuiltins zshbuiltins(1) man page]</ref>)}} |{{yes}} |{{yes}}<br>{{small|({{mono|fds}} up to 9)<ref>{{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}}</ref>}} |{{yes}}<br>{{small|(via variables, options, functions, styles, etc.)}} |{{yes}}<br>{{small|(system and user's {{mono|zshenv}}, {{mono|zprofile}}, {{mono|zshrc}}, {{mono|zlogin}}, {{mono|zlogout}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[Almquist shell|ash]] |[[POSIX]] |sh |1989 |{{yes}} |[[Minix]], [[BusyBox]] based systems |[[NetBSD]], [[Minix]], [[BusyBox]] based systems |{{free|[[BSD licenses|BSD]]-style}} |{{yes}} |Text-based CLI |{{no}} |{{partial}}<br>{{small|(for BusyBox, supported in command-line editing, but not in string handling<ref>{{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}}</ref>)}} |{{N/A}} |{{yes}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|({{mono|/etc/profile}}, {{mono|.profile}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}} |{{yes}} |- ![[CP/M#Console_Command_Processor|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 [[Command-line interface|CLI]] |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} (automatic via {{mono|$$$.SUB}}) |{{partial}}<br>{{small|(only via external {{mono|SUBMIT}} command to update {{mono|$$$.SUB}})}} |{{no}} |{{yes}} |- ![[COMMAND.COM]] |[[DOS]] |[[COMMAND (DOS command)|COMMAND]] |1980 |{{no}}<br>{{small|(3rd party implementations, not bound to a specific DOS vendor or version, available)}} |[[DOS]], [[Windows 95]], [[Windows 98|98]], [[Windows 98 SE|SE]], [[Windows ME|ME]] |[[DOS]], [[Windows 95]], [[Windows 98|98]], [[Windows 98 SE|SE]], [[Windows ME|ME]] |vendor specific, f.e. [[Microsoft|MS]]-[[Software license agreement|EULA]],<ref group="nb">MS-DOS and Windows component – covered by a valid license for MS-DOS or Microsoft Windows.</ref> 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}}<br>{{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)|CMD.EXE]] |[[OS/2]], [[eComStation]], [[ArcaOS]] |[[CMD (OS/2 command)|CMD]] |1987 |{{no}} |[[OS/2]], [[eComStation]], [[ArcaOS]] |[[OS/2]], [[eComStation]], [[ArcaOS]] |{{proprietary|[[IBM]]-[[Software license agreement|EULA]]}}<ref group="nb">OS/2 component – covered by a valid license for OS/2.</ref> |{{no}} |Text-based CLI |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}}<br>{{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.exe|CMD.EXE]]<ref group="nb" name="cmd /x">Command extensions enabled, or "CMD /X".</ref> |[[Win32]] |[[CMD (Windows command)|CMD]] |1993 |{{no}} |[[Microsoft Windows|Windows]] NT, 2000, XP, Server 2003, Vista |[[Microsoft Windows|Windows]] NT, 2000, XP, Server 2003, Vista |{{proprietary|[[Microsoft|MS]]-[[Software license agreement|EULA]]}}<ref group="nb" name="ReferenceA">Windows component – covered by a valid license for Microsoft Windows.</ref> |{{no}} |Text-based CLI |{{no}} |{{partial}} ({{mono|[[CHCP (command)|CHCP]] [[Code page 65001|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]], [[Windows 98|98]], [[Windows 98 SE|SE]], [[Windows ME|ME]] |[[4DOS]], [[NDOS]] |1989 (1986)<!-- Rex Conn started 4DOS in 1986, first versions were posted on Compuserve in 1988, shareware versions (4DOS 2.0) were released through JP Software since 1989. --> |{{no}}<br>{{small|(not bound to a specific OS vendor or version)}} |{{optional}} |{{optional}} |{{free|[[MIT License]], with restrictions}} |{{yes}} |Text-based CLI with [[text-based user interface|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}}<br>{{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}}<br>{{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}}<br>{{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}} |- ![[Take Command Console|TCC]]<br>(formerly 4NT) |[[Win32]] |TCC |1993 |{{no}}<br>{{small|(not bound to specific NT versions)}} |optional |optional |{{proprietary|[[Shareware]]}} |{{no}} |Text-based CLI ([[Take Command (command line interpreter)|Take Command]]: [[GUI]]) |{{yes}}<br>{{small|(console mouse, popups, help system, {{mono|%_XMOUSE}}, {{mono|%_YMOUSE}} internal variables, {{mono|INKEY /M}} command)}} |{{yes}} |{{yes}} |{{no}} |{{yes}}<br>{{small|({{mono|stdin}}, {{mono|stdout}}, {{mono|stderr}}, {{mono|stdout+stderr}})}} |{{yes}}<br>{{small|(via registry, {{mono|TCMD.INI}}/{{mono|4NT.INI}} file, startup parameters, environment variables, {{mono|SETDOS}} command)}} |{{yes}}<br>{{small|(automatic via registry and {{mono|TCSTART}}/{{mono|4START}} as well as {{mono|TCEXIT}}/{{mono|4EXIT}}, or explicitly via {{mono|/K}} startup option)}} |{{yes}}<br>{{small|(via {{mono|CALL}} command or {{mono|/C}} and {{mono|/K}} startup options)}} |{{yes}} |{{no}} |- ![[DIGITAL Command Language|VMS DCL]]<ref>{{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 }}</ref> |[[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}}<br>{{small|({{mono|sys$input}}, {{mono|sys$output}} assignment)}} |{{yes}}<br>{{small|(via symbols, logical names, and options)}} |{{yes}}<br>{{small|(SYS$MANAGER:SYLOGIN.COM and user defined LOGIN.COM)}} |{{yes}} |{{yes}} |{{no}} |- ![[PowerShell]] ||[[.NET Core|.NET]],<br>[[.NET Framework]] |PowerShell |2006 |{{yes}} |[[Microsoft Windows|Windows]] 10, 8, Server 2008, 7<ref group="nb" name="optional">Microsoft PowerShell is installed by default on Windows 7 and later. It is an optional download for users of Windows Vista or Windows XP.</ref> |[[Microsoft Windows|Windows]] 10, 8, Server 2008, 7 |{{free|[[MIT license|MIT]]-style}} |{{yes}} |Graphical CLI |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}}<br>{{small|(via variables and options)}} |{{yes}}<br>{{small|(%USERPROFILE%\Documents \WindowsPowerShell\Microsoft.PowerShell_profile.ps1)}} |{{yes}}<br>{{small|(PowerShell feature)}} |{{yes}} |{{no}} |- ![[Rc (Unix shell)|rc]] |[[Plan 9 from Bell Labs|Plan 9]], [[POSIX]] |rc |1989 |{{yes}} |[[Plan 9 from Bell Labs|Plan 9]], [[Version 10 Unix]] |[[Plan 9 from Bell Labs|Plan 9]], [[Version 10 Unix]] |{{free|[[MIT License]]<ref>{{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}}</ref>}} |{{yes}} |Text-based CLI |{{dunno}} |{{yes}} |{{yes}} |{{dunno}} |{{yes}} |{{yes}}<br>{{small|(via options)}} |{{yes}}<br>{{small|({{mono|$HOME/.rcrc}})}} |{{yes}} |{{dunno}} |{{yes}} |- ![[BeanShell]] |[[Java virtual machine|Java]] |{{dunno}} |2005 |{{yes}} |{{dunno}} |{{dunno}} |{{free|[[LGPL]]}} |{{dunno}} |{{dunno}} |{{dunno}} |{{yes}} |{{dunno}} |{{dunno}} |{{yes}} |{{dunno}} |{{dunno}} |{{dunno}} |{{dunno}} |{{no}} |- ![[Friendly interactive shell|fish]] |[[POSIX]] |fish |2005<ref>{{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}}</ref> |{{yes}} |[[GhostBSD]] |{{dunno}} |{{free|[[GPL]]}} |{{yes}} |Text-based CLI |{{dunno}} |{{yes}} |{{dunno}} |{{dunno}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(through environment variables and via web interface through {{mono|fish_config}})}} |{{yes}}<br>{{small|({{mono|/etc/fish/config.fish}} and {{mono|~/.config/fish/config.fish}})}} |{{yes}}<br>{{small|(Unix feature)}} |{{yes}}<br>{{small|({{mono|~/.config/fish/fish_history*}})}} |{{dunno}} |- !Ion |[[Redox (operating system)|Redox]], [[Linux]] |ion |2015<ref>{{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}}</ref> |{{yes}} |[[Redox (operating system)|Redox]] |[[Redox (operating system)|Redox]] |{{free|[[MIT license|MIT]]}} |{{yes}} |Text-based CLI |{{dunno}} |{{yes}} |{{yes}} |{{dunno}} |{{yes}}<br>{{small|({{citation needed span|date=December 2021|arbitrary {{mono|fds}}}})}} |{{yes}}<br>{{small|(follows the XDG Base Directory spec)}} |{{yes}}<br>{{small|({{mono|~/.config/ion/initrc}})}} |{{yes|Yes}} |{{yes}}<br>{{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 ![[Cross-platform|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]] ![[Standard streams|Stream]] [[Redirection (computing)|redirection]] !Configurability<!-- yes/no/which, persistent via config files, registry, temporary via env vars, startup scripts - might require a table of its own --> !Startup/shutdown scripts !Batch scripts !Logging<!-- - might require a table of its own --> !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|[[#Completions|Command<br>name<br>completion]]}} !{{small|[[#Completions|Path<br>completion]]}} !{{small|[[#Completions|Command<br>argument<br>completion]]}} !{{small|[[#Completions|Wildcard<br>completion]]}} !{{small|[[#Command history|Command<br>history]]}} !{{small|[[#Mandatory argument prompt|Mandatory<br>argument<br>prompt]]}} !{{small|[[#Automatic suggestions|Automatic<br>suggestions]]}} !{{small|[[#Colored directory listings|Colored<br>directory<br>listings]]}} !{{small|[[#Text highlighting|Text<br>highlighting]]}} !{{small|[[#Syntax highlighting|Syntax<br>highlighting]]}} !{{small|[[#Directory history, stack or similar features|Directory history, stack or similar features]]}} !{{small|[[#Implicit directory change|Implicit<br>directory<br>change]]}} !{{small|[[#Autocorrection|Auto­correction]]}} !{{small|Integrated<br>environment}} !{{small|Snippets}} !{{small|Value<br>prompt}} !{{small|Menu/options<br>prompt}} !{{small|[[#Progress indicator|Progress<br>indicator]]}} !{{small|[[#Context sensitive help|Context<br>sensitive<br>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}}<ref group="nb" name="ReferenceB">current versions from Jörg Schilling.</ref> |{{no}} |{{no}} |{{yes}}<ref group="nb" name="ReferenceB"/> |{{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}}<br>{{small|({{mono|CDPATH}})}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{partial|External}} |{{no}} |- ![[Bash (Unix shell)|bash]] (v4.0) |{{yes}} |{{yes}} |{{yes}} |{{yes}}<ref group="nb">Alt-Shift-8 or Alt-* will expand to the full matching list of filenames.</ref> |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |{{yes}}<br>{{small|({{mono|CDPATH}}, {{mono|pushd}}, {{mono|popd}})}} |{{yes|optional}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{partial|External}} |{{no}} |- ![[C shell|csh]] |{{yes}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |{{yes}}<br>{{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}}<br>{{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}}<br>{{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}} |- ![[Korn Shell|ksh]] (ksh93t+) |{{yes}}<br>{{small|(extendable)}} |{{yes}}<br>{{small|(extendable)}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |{{yes}}<br>{{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}}<ref>{{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}}</ref> |{{yes}} |{{yes}}<ref>This applies only on reserved words and other syntactic features.</ref> |{{yes}}<br>{{small|(via {{mono|predict-on}} or user-defined<ref>e.g. via 3rd party such as [https://github.com/tarruda/zsh-autosuggestions zsh-autosuggestions]</ref>)}} |{{yes}} |{{yes}} |{{partial|Third-party extension}}<ref>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]</ref> |{{yes}} |{{yes|optional}} |{{yes}} |{{no}} |{{yes2|when defined (as ZLE widgets)}} |{{yes}} |{{yes}} |{{partial|External}} |{{yes}} |- ![[Almquist shell|ash]] |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{partial|External}} |{{no}} |- ![[CP/M#Console_Command_Processor|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}}<ref group="nb" name="doskey">Available through the {{mono|[[DOSKEY]]}} add-on.</ref><ref group="nb" name="drdos">Available in DR-DOS through {{mono|[[HISTORY (CONFIG.SYS directive)|HISTORY]]}}.</ref> |{{no}} |{{no}} |{{no}} |{{no}} (only in DR-DOS through [[%$ON%]], [[%$OFF%]], [[%$HEADER%]], [[%$FOOTER%]]) |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} (only single-stepping with COMMAND /Y<ref name="Paul_1997_OD-A3"/>) |{{no}} |{{no}} |{{no}} (only via external {{mono|CHOICE}} command, in DR-DOS also via {{mono|SWITCH}} / {{mono|DRSWITCH}} internal commands) |{{no}} |{{no}} |- !OS/2<br>[[CMD.EXE]] |{{yes}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |- !Windows<br>[[CMD.EXE]] |{{yes2|partial}} |{{yes2|partial}} |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|F8}})}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|PUSHD}}, {{mono|POPD}})}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} (via {{mono|SET /P}} command) |{{no}} |{{no}} |{{no}} |- ![[4DOS]] |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}}<ref group="nb" name="doskey_4dos">Alternatively available through the {{mono|[[DOSKEY]]}} add-on as well.</ref><ref group="nb" name="drdos_4dos">Alternatively available in DR-DOS through {{mono|[[HISTORY (CONFIG.SYS directive)|HISTORY]]}} as well.</ref> |{{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}} |- ![[Take Command Console|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)<ref group="nb">TCC has special prompt functions for Yes, No, Cancel, Close, Retry.</ref> |{{no}} |{{yes}} |- ![[Windows PowerShell|PowerShell]] |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}}<br>{{small|({{mono|F8}})}} |{{yes}} |{{yes|Yes; via PSReadLine<ref name="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}}</ref> module (bundled in v5.0<ref>{{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 }}</ref>) or in ISE<ref name="powershell_ise"/>}} |{{partial|Third-party extension}}<ref>{{Cite web|url=https://github.com/joonro/Get-ChildItemColor|title = Get-ChildItemColor|website = [[GitHub]]|date = 18 March 2022}}</ref> |{{yes}}<ref>{{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 = }}</ref> |{{yes|Yes; via PSReadLine<ref name="PSReadLine"/> module (bundled in v5.0) or in ISE<ref name="powershell_ise"/>}} |{{yes}}<br>{{small|(multiple stacks; multiple location types;<ref>[https://technet.microsoft.com/en-us/library/hh849855.aspx Push-Location] (with alias <code>pushd</code>) and [https://technet.microsoft.com/en-us/library/hh849842.aspx Pop-Location] (with alias <code>popd</code>) 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.</ref> {{mono|Push-Location}}, {{mono|Pop-Location}})}} |{{yes2}}Yes, in PSReadLine<ref name="PSReadLine"/> module |{{yes2}}Yes, in ISE<ref name="powershell_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}}</ref> |{{yes2}}Yes, in ISE<ref name="powershell_ise"/> |{{yes}} |{{yes}}<ref>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.</ref> |{{yes}}<ref>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.</ref> |{{yes}}, in ISE<ref name="powershell_ise"/> |{{yes|popup window}}<ref>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</ref> |- ![[Rc (Unix shell)|rc]] |{{yes}}<ref group="nb" name="rio">Handled by [[Rio (program)|rio]], [[GNU readline]], [[editline]] or [[vrl]].</ref> |{{yes}}<ref group="nb" name="rio"/> |{{no}} |{{no}} |{{yes}}<ref group="nb" name="rio"/> |{{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}} |- ![[DIGITAL Command Language|VMS DCL]] |{{yes|Minimum uniqueness scheme}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |? |? |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{no}} |- ![[Friendly interactive shell|fish]] |{{yes}} |{{yes}} |{{yes}}<ref name="fishcompletion">{{cite web |url=http://fishshell.com/docs/current/index.html#completion |title=fish: Documentation |at=Section ''Tab completion'' |access-date=2016-01-10}}</ref> |{{yes}}<ref name="fishcompletion"/> |{{yes}} |{{no}} |{{yes}} |{{yes}} |{{yes}}<br>{{small|(built-in helper available<ref>{{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 }}</ref>)}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}}<ref group="nb">The fish shell is an interactive character based input/output surface.</ref> |{{yes| Yes, using {{mono|abbr}} command}} |{{yes}} |{{yes| (via {{mono|fish_config}} command<ref>{{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}}</ref>)}} |{{no}} |{{no}} |- !Shell ![[#Completions|Command<br>name<br>completion]] ![[#Completions|Path<br>completion]] ![[#Completions|Command<br>argument<br>completion]] ![[#Completions|Wildcard<br>completion]] ![[#Command history|Command<br>history]] ![[#Mandatory argument prompt|Mandatory<br>argument<br>prompt]] ![[#Automatic suggestions|Automatic<br>suggestions]] ![[#Colored directory listings|Colored<br>directory<br>listings]] ![[#Text highlighting|Text<br>highlighting]] ![[#Syntax highlighting|Syntax<br>highlighting]] ![[#Directory history, stack or similar features|Directory history, stack or similar features]] ![[#Implicit directory change|Implicit<br>directory<br>change]] ![[#Autocorrection|Auto­correction]] !Integrated<br>environment !Snippets !Value<br>prompt !Menu/options<br>prompt ![[#Progress indicator|Progress<br>indicator]] ![[#Context sensitive help|Context<br>sensitive<br>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|right|thumb|402px|Command-line completion in [[Bash (Unix shell)|Bash]].]]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 <code>$PATH</code>), 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 [[#String processing and filename matching|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 parameter|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.<ref>{{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}}</ref> The fish shell additionally supports parsing of [[man page]]s 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|right|thumb|upright=2|Command-line completion in [[PowerShell]].]]Shells featuring automatic suggestions display optional command-line completions as the user types. The [[PowerShell]] and [[Fish (Unix shell)|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<ref>{{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}}</ref> and [[Z shell|zsh]]<ref>{{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}}</ref> use an external module to provide completions, and fish derives its completions from the user's command history.<ref>{{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}}</ref> === 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<ref>{{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}}</ref> in the release of [[C shell|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]], [[Datapac System Manager|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.<ref name="DRI_1987_CDOS_User">{{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}}</ref> === Autocorrection === [[File:Zsh autocompletion and autocorrection demo.gif|thumb|upright=2.0|Zsh autocompletion and autocorrection demo for a [[telnet]] 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<ref name="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".<ref>{{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}}</ref> 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. <!-- To be added: Other command line processors provide similar features, but COMMAND.COM does not. --> 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]]<!-- COMMAND.COM/DOSPLUS.COM -->, <!-- TBD: possibly also some versions of Concurrent DOS -->[[Multiuser DOS]]<!-- TMP.EXE -->, [[REAL/32]] and in all versions of [[DR-DOS]]<!-- COMMAND.COM/DRDOS.COM --> 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 (DOS command)|TYPE]]. All mentioned command line processors support <code>[[%$ON%]]</code> and <code>[[%$OFF%]]</code>. 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 <code>[[%$HEADER%]]</code> and <code>[[%$FOOTER%]]</code> 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. <!-- TBD. Other command-line processors may provide similar features. --> 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.<ref>{{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}}</ref> An independent project offers syntax highlighting as an add-on to the Z Shell (zsh).<ref>{{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}}</ref> This is not part of the shell, however. PowerShell provides customizable syntax highlighting on the command line through the PSReadLine<ref name="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.<ref>{{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}}</ref> 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 ![[Subroutine|Functions]] ![[Exception handling]] !Search & replace<br/>on variable substi­tutions !{{verth|[[Arithmetic]]}} !{{verth|[[Floating point]]}} !Math function library ![[Array data type|Linear arrays]] or [[List (abstract data type)|lists]] !{{verth|[[Associative array|Assoc­iative<br/>arrays]]}} !{{verth|[[Lambda calculus|Lambda<br/>functions]]}} !{{verth|[[eval|eval<br/>function]]}} ![[Pseudorandom number generator|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}}<ref group="nb" name="ReferenceB"/> |{{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 (Unix shell)|bash]] (v4.0) |{{yes}} |{{yes| Yes (via {{mono|trap}})}} |{{yes}}<br>{{small|(via {{mono|${//}}} syntax)}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}} |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|$RANDOM}}) }} |{{no}} |- ![[C shell|csh]] |{{no}} |{{no}} |{{yes}}<br>{{small|(via {{mono|$var:s///}} syntax)}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[tcsh]] |{{partial|Work in progress<ref>[https://github.com/tcsh-org/tcsh/pull/77 ''Introduce 'function' built-in''] by Matheus Garcia</ref>}} |{{no}} |{{yes}}<br>{{small|(via {{mono|$var:s///}} syntax)}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[Hamilton C shell]] |{{yes}} |{{no}} |{{yes}}<br>{{small|(via {{mono|$var:s///}} syntax)}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes| Yes (random utility)}} |{{no}} |- ![[Scsh]] |{{yes}} |? |{{yes}}<br>{{small|(via string functions and regular expressions)}} |? |? |? |{{yes}} |? |{{yes}} |{{yes}} |{{yes}}<br>{{small|(random-integer, random-real)}} |{{yes}}<br>{{small|(compiler is Scheme48 virtual machine, via {{mono|scshvm}})}} |- ![[Korn Shell|ksh]] (ksh93t+) |{{yes}} |{{yes| Yes (via {{mono|trap}})}} |{{yes}}<br>{{small|(via {{mono|${//}}} syntax and builtin commands)}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|$RANDOM}})}} |{{yes}}<br>{{small|(compiler is called {{mono|shcomp}})}} |- ![[pdksh]] |{{yes}} |{{yes| Yes (via {{mono|trap}})}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|$RANDOM}})}} |{{no}} |- ![[zsh]] |{{yes}} |{{yes}} |{{yes}}<br>{{small|(via {{mono|${:s//}}} and {{mono|${//}}} syntax)}} |{{yes}} |{{yes}} |{{yes}}<br>{{small|({{mono|zsh/mathfunc}} module)}} |{{yes}} |{{yes}} |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|$RANDOM}})}} |{{yes}}<br>{{small|(built-in {{mono|zcompile}} command)}} |- ![[Almquist shell|ash]] |{{yes}} |{{yes}} (via {{mono|trap}}) |{{no}} |{{yes}}<br>{{small|(since 1992)<ref>{{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 }}</ref>}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[CCP (CP/M)|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}}<br>{{small|(via {{mono|CALL :label}})}} |{{no}} |{{yes}}<br>{{small|(via {{mono|SET %''varname'':''expression''}} syntax)}} |{{yes}}<br>{{small|(via {{mono|SET /A}})<ref>{{cite web |url=https://ss64.com/nt/set.html |title=Set - Environment Variable - Windows CMD |publisher=SS64.com |access-date=2015-02-24}}</ref>}} |{{no}} |{{no}} |{{yes}}<br>{{small|(via {{mono|SET}}<ref>{{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}}</ref>)}} |{{no}} |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|%random%}})}} |{{no}} |- ![[4DOS]] |{{yes}} |{{yes}}<br>{{small|(via {{mono|ON}} command, optional Auto-fail via {{mono|4DOS /F}})}} |{{yes}}<br>{{small|(via {{mono|%@Replace[...]}} function)}} |{{yes}}<br>{{small|(via {{mono|SET /A}})}} |? |? |{{yes}}<br>{{small|(via ranges, include lists, {{mono|@}}file lists and {{mono|FOR}} command)}} |{{no}} |{{no}} |{{yes}} |{{yes}}<br>{{small|({{mono|%@Random[...]}} function)}} |{{yes}}<br>{{small|(via {{mono|BATCOMP}} command)}} |- ![[4OS2]] |? |? |? |? |? |? |? |? |{{no}} |{{yes}} |{{yes}} ({{mono|%@Random[...]}} function) |? |- ![[Take Command Console|TCC]] (formerly 4NT) |{{yes}} |{{yes}}<br>{{small|(via {{mono|ON}} and various {{mono|...MONITOR}} commands)}} |{{yes}}<br>{{small|(via {{mono|%@Replace[...]}} function)}} |{{yes}}<br>{{small|(via {{mono|SET /A}})}} |? |? |{{yes}}<br>{{small|(via ranges, include lists, {{mono|@}}file lists and {{mono|FOR}} command)}} |? |{{no}} |{{yes}} |{{yes}} ({{mono|%@Random[...]}} function) |{{yes}} (via {{mono|BATCOMP}} command) |- ![[Windows PowerShell|PowerShell]] |{{yes}} |{{yes}} (Try-Catch-Finally) |{{yes}}<br>{{small|({{mono|-replace}} operator)}} |{{yes}} |{{yes}} |{{yes|[Math] class}}<ref>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]</ref> |{{yes}} |{{yes}} |{{yes}}<ref>{{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}}</ref> |{{yes}} |{{yes}} |{{yes|Yes, automatic}} |- ![[Rc (Unix shell)|rc]] |{{yes}} |{{yes}} |{{no}} |{{yes}} |? |? |{{yes}} |? |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[BeanShell]] |{{yes}} |{{yes}} |? |{{yes}} |? |? |{{yes}} |{{yes}} |{{no}} |{{yes}} |{{yes}} |{{yes}} |- ![[DIGITAL Command Language|VMS DCL]] |{{yes}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{yes|yes, for compiled programs}} |{{yes}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |- ![[friendly interactive shell|fish]] |{{yes}} |{{yes| Yes (via {{mono|trap}})}} |{{yes|Yes, via {{mono|string}} builtin command<ref>{{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}}</ref>}} |{{yes}} |{{yes}} |{{yes}} |{{yes}} |{{no}} |{{no}} |{{yes}} |{{yes}}<br>{{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 (string expansion)|Alternation]] ([[Brace expansion]]) !Pattern matching ([[regular expression]]s built-in) !Pattern matching (filename [[glob (programming)|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}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}} |{{no}} |{{no}} |- ![[Bourne shell]] recent version |{{partial}} (prefix and suffix stripping in variable expansion) |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}} |{{no}} |{{no}} |- ![[POSIX]] shell |{{partial}} (prefix and suffix stripping in variable expansion) |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}} |{{no}} |{{no}} |- ![[Bash (Unix shell)|bash]] (v4.0) |{{partial}} (prefix and suffix stripping in variable expansion) |{{yes}} |{{yes}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, {{mono|{...}}})}} |{{no}} |{{yes}} ({{mono|**/...}}) |- ![[C shell|csh]] |{{yes}}<br>{{small|(:s and other editing operators)}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[tcsh]] |{{yes}}<br>{{small|(:s and other editing operators)}} |{{yes}} |{{yes}} |{{yes}} |{{no}} |{{no}} |- ![[Hamilton C shell]] |{{yes}}<br>{{small|(:s and other editing operators + substr, strlen, strindex, printf, reverse, upper, lower, concat and other builtin functions)}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{yes}}<br>{{small|(via indefinite directory {{mono|"..."}} wildcard<ref>{{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.}}</ref>)}} |- ![[Scsh]] |? |? |{{yes}} |{{yes}} |{{no}} |{{no}} |- ![[Korn Shell|ksh]] (ksh93t+) |{{partial}} (prefix, suffix stripping and string replacement in variable expansion) |{{yes}}<ref name="Apress">{{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.}}</ref> |{{yes}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}} |{{no}} |{{yes}} (with {{mono|set -G}}, no following of symlinks) |- ![[pdksh]] |? |{{yes}}<ref name="Apress"/> |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[zsh]] |{{yes}} (through variable processing: e.g. substring extraction, various transformations via parameter expansion) |{{yes}} |{{yes}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}}, [[extended globbing]]<ref name="extended globbing">Zsh offers a variety of [https://zsh.sourceforge.io/Guide/zshguide05.html#l135 globbing options].</ref>)}} |{{yes}} |{{yes}} ({{mono|**/...}} or {{mono|***/...}} to follow symlinks) |- ![[Almquist shell|ash]] |? |? |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[CCP (CP/M)|CCP]] |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |- ![[COMMAND.COM]] |{{no}} |{{no}} |{{no}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}})}} |{{no}} |{{no}} |- !OS/2 [[CMD.EXE]] |{{no}} |{{no}} |{{no}} |{{yes}}<br>{{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|No<ref group="nb">Not available as a shell built-in. External {{mono|FINDSTR /R}} command is available in most Windows releases.</ref>}} |{{yes}}<br>{{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}}<br>{{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}} |? |? |? |- ![[Take Command Console|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}}<br>{{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) |- ![[Windows PowerShell|PowerShell]] |{{yes}}<br>{{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<ref>{{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 = }}</ref>}} |{{yes}}<br>{{small|(full regex support)<ref group="nb">PowerShell leverages the full [[.NET Framework|.NET]] regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.</ref>}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|[...]}})}} |? |? |- ![[Rc (Unix shell)|rc]] |? |? |{{no}} |{{yes}} |{{no}} |{{no}} |- ![[BeanShell]] |? |? |{{yes}} |? |? |? |- ![[DIGITAL Command Language|VMS DCL]] |{{yes}} |{{no}} |{{no}} |{{yes}} |{{no}} |{{yes}} (via {{mono|[SUBDIR...]}}) |- ![[friendly interactive shell|fish]] |{{yes}}<br>{{small|(builtin string function)}} |{{yes|Yes}} |{{yes}}<br>{{small|(via builtin {{mono|string match}} and {{mono|string replace}} functions)}} |{{yes}}<br>{{small|({{mono|*}}, {{mono|?}}, {{mono|{...}}})}} |{{no}} |{{yes}} ({{mono|**/...}}) |} ==Inter-process communication== {| class="wikitable sortable" style="width: auto; text-align: center; font-size: smaller;" |- !Shell ![[Pipeline (software)|Pipes]] ![[Command substitution]] ![[Process substitution]] !Subshells ![[Transmission Control Protocol|TCP]]/[[User Datagram Protocol|UDP]] connections as streams ![[#Keystroke stacking|Keystroke stacking]] |- ![[Bourne shell]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation">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).</ref> |- ![[POSIX]] shell |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[Bash (Unix shell)|bash]] (v4.0) |{{yes|bytes concurrent}} |{{yes}} |{{yes}}<br>{{small|(if system supports {{mono|/dev/fd/''{{angbr|n}}''}} or named pipes)}} |{{yes}} |{{yes}}<br>{{small|(client only)}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[C shell|csh]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[tcsh]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[Hamilton C shell]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |? |- ![[Scsh]] |{{yes|text}} |? |? |? |{{yes}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[Korn Shell|ksh]] (ksh93t+) |{{yes|bytes (may contain serialized objects if {{mono|print -C}} is used) concurrent}} |{{yes}}<br>{{small|({{mono|$(...)}} and {{mono|${<space>...;}}})}} |{{yes}}<br>{{small|(if system supports {{mono|/dev/fd/''{{angbr|n}}''}})}} |{{yes}} |{{yes}}<br>{{small|(and SCTP support, client only)}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[pdksh]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[zsh]] |{{yes|bytes concurrent}} |{{yes}} |{{yes}} |{{yes}} |{{yes}}<br>{{small|(client and server, but only TCP)}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[Almquist shell|ash]] |{{yes|bytes concurrent}} |{{yes}} |{{no}} |{{yes}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |- ![[CCP (CP/M)|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}}<br>{{small|(via {{mono|FOR /F}} command)}} |{{no}} |{{yes}}<br>{{small|(Backtick: {{mono|`}} in {{mono|FOR /F usebackq}})}} |{{no}} |{{no}} |- ![[4DOS]] |{{yes|text sequential temporary files}} |{{yes}}<br>{{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.COM|KSTACK]]}})<ref name="4DOS_8.00_HELP">{{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}}</ref> |- ![[4OS2]] |{{yes|text concurrent}} |? |? |? |{{no}} |{{yes}} (via {{mono|KEYSTACK}}) |- ![[Take Command Console|TCC]] (formerly 4NT) |{{yes|text concurrent}} |{{yes}}<br>{{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}}) |- ![[Windows PowerShell|PowerShell]] |{{yes|objects concurrent}} |{{yes}} |{{no}} |{{yes}} |{{yes}} |? |- ![[Rc (Unix shell)|rc]] |{{yes|text concurrent}} |{{yes}} |{{yes}}<br>{{small|(via: {{mono|<{cmd}}} if system supports {{mono|/dev/fd/''{{angbr|n}}''}})}} |{{yes}} |{{no}} |? |- ![[BeanShell]] |{{no|not supported}} |? |? |? |{{yes}} |? |- ![[DIGITAL Command Language|VMS DCL]] |{{yes|text (via {{mono|PIPE}} command)}} |{{yes}} |{{no}} |{{yes}}<br>{{small|(spawn)}} |{{yes}}<br>{{small|(server TCP only)}} |{{no}} |- ![[friendly interactive shell|fish]] |{{yes|bytes concurrent}} |{{yes}} ({{mono|...}}) |{{No|No (broken)<ref>{{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}}</ref>}} |{{no}} |{{no}} |{{N/A|N/A}}<ref group="nb" name="xautomation"/> |} ===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 prompt|Secure (password) prompt]] !File/directory passwords ![[#Execute permission|Execute permission]] ![[#Restricted shell subset|Restricted shell subset]] ![[#Safe data subset|Safe data subset]] |- ![[Bourne shell]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty">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.</ref> |? |{{N/A|N/A}}<ref group="nb" name="hashbang">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.</ref> |{{yes}} |{{no}} |- ![[POSIX]] shell |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{no}} |{{no}} |- ![[Bash (Unix shell)|bash]] (v4.0) |{{yes|{{mono|read -s}}}} |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[C shell|csh]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[tcsh]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[Hamilton C shell]] |{{no}} |{{no}} |{{no}} |{{no}} |{{no}} |- ![[Scsh]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{no}} |{{no}} |- ![[Korn Shell|ksh]] (ksh93t+) |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[pdksh]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[zsh]] |{{yes|{{mono|read -s}}}} |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/><ref group="nb" name="xperm-complete">The zsh and fish shells also honor the ''execute permission'' for command completion.</ref> |{{yes}} |{{no}} |- ![[Almquist shell|ash]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}} |{{no}} |- ![[CCP (CP/M)|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)<ref group="nb" name="drpwd">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.</ref> |{{partial}} (only under DR-DOS, if files are password-protected for read and/or execute permission)<ref group="nb" name="drexec">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.</ref> |{{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}})<ref group="nb" name="input/p">{{mono|INPUT /P}} and {{mono|INKEY /P}} echoes back asterisks for each typed character.</ref> |{{partial}} (only under DR-DOS via {{mono|\dirname;;dirpwd\filename;;filepwd}} syntax)<ref group="nb" name="drpwd"/> |{{partial}} (only under DR-DOS, if files are password-protected for read and/or execute permission)<ref group="nb" name="drexec"/> |{{no}} |{{no}} |- ![[4OS2]] |? |{{no}} |{{no}} |{{no}} |{{no}} |- ![[Take Command Console|TCC]] (formerly 4NT) |{{yes}} (via {{mono|INPUT /P}}, {{mono|INKEY /P}} or {{mono|QUERYBOX /P}})<ref group="nb" name="input/p"/> |{{no}} |{{no}} |{{no}} |{{no}} |- ![[Windows PowerShell|PowerShell]] |{{yes}}<ref group="nb">{{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.</ref> |{{no}} |{{no}}<ref group="nb">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.</ref> |{{yes}}<ref group="nb">Startup scripts per computer/user can import modules and expose a subset the commands/functions available in the modules.</ref> |{{yes}}<ref>{{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}}</ref> |- ![[Rc (Unix shell)|rc]] |{{some|via {{mono|stty}}}}<ref group="nb" name="tty"/> |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/> |{{yes}}<ref>{{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}}</ref> |{{no}} |- ![[BeanShell]] |? |? |? |? |? |- ![[DIGITAL Command Language|VMS DCL]] |{{yes}} |{{no}} |{{yes}} |{{yes}} |{{no}} |- ![[Friendly interactive shell|fish]] |{{yes|{{mono|read -s}}}} |? |{{N/A|N/A}}<ref group="nb" name="hashbang"/><ref group="nb" name="xperm-complete"/> |{{yes| Yes (via {{mono|fish -l}})}} |? |} === Secure prompt === Some shell scripts need to query the user for sensitive information such as [[password]]s, private digital keys, [[Personal Identification Number|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.<ref name="encryptmemory">{{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}}</ref> The shells bash, zsh and PowerShell offer this as a specific feature.<ref>{{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.}}</ref><ref>{{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}}</ref> 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.<ref>{{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 }}</ref> 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 [[Loader (computing)|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 [[C POSIX library|POSIX C library]] that is used for interfacing with the kernel. POSIX specifies that the <code>exec</code> 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.<ref>{{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 }}</ref><ref>{{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}}</ref> 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.<ref>{{cite web |url=https://technet.microsoft.com/en-us/library/hh849712.aspx |title=New-PSSessionConfigurationFile |publisher=Technet.microsoft.com |access-date=2013-08-18}}</ref> === 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.<ref>{{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.}}</ref> 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= <ref name="Paul_1997_OD-A3">{{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<!-- Op702src.zip is an unofficial renamed distribution of the ibmbioa3.zip file -->]</ref> }} ==External links== * {{cite book |url= https://www.linux-magazine.com/Issues/2007/78/Bash-vs.-Vista-PowerShell |date= May 2007 |title= Comparing Bash with the Windows Vista shell: Shell Games |first= Marcus |last= Nasarek |publisher= [[Linux Magazine]] |chapter= Article |chapter-url= https://www.linux-magazine.com/content/download/63303/487727/version/1/file/Bash_vs._Vista_PowerShell.pdf |url-status= live |archive-date= Oct 10, 2014 |archive-url= https://web.archive.org/web/20141010000744/http://w3.linux-magazine.com/issue/78/Bash_vs._Vista_PowerShell.pdf }} * {{cite web |url= https://pubs.opengroup.org/onlinepubs/9799919799/utilities/contents.html |title= Shell and Utilities |date= 2024-08-08 |edition= 2024 |issue= 8 |work= IEEE Standard for Information Technology 1003.1™-2024 – Portable Operating System Interface POSIX™.1-2024 — The Open Group Base Specifications Issue 8 |publisher= The IEEE and The Open Group }} {{Unix shells}} {{DEFAULTSORT:Comparison Of Command Shells}} [[Category:Command shells]] [[Category:Software comparisons|Shells]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Better source needed
(
edit
)
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite newsgroup
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Dunno
(
edit
)
Template:Free
(
edit
)
Template:Further
(
edit
)
Template:Importance section
(
edit
)
Template:Keypress
(
edit
)
Template:Main article
(
edit
)
Template:Man
(
edit
)
Template:Mono
(
edit
)
Template:More citations needed
(
edit
)
Template:N/A
(
edit
)
Template:No
(
edit
)
Template:Optional
(
edit
)
Template:Partial
(
edit
)
Template:Proprietary
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Small
(
edit
)
Template:Snd
(
edit
)
Template:Some
(
edit
)
Template:Sort-under
(
edit
)
Template:Sticky header
(
edit
)
Template:Unix shells
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Verth
(
edit
)
Template:Yes
(
edit
)
Template:Yes2
(
edit
)