Comparison of command shells

From Wikipedia, the free encyclopedia
  (Redirected from Comparison of computer shells)
Jump to: navigation, search

A command shell is a command line interface computer program to an operating system.

Contents

[edit] General characteristics

Usual environment Usually invoked Introduced Platform-independent Default login shell in Default script shell in License Unicode Stream redirection Native CIM/WBEM support Blocking of unsigned scripts available as statically linked, independent single file executable
Bourne shell 7th Ed. UNIX sh 1977 No 7th Ed. UNIX 7h Ed. UNIX AT&T prop.[1] No Yes (arbitrary fds) No No Yes
POSIX shell[2] POSIX sh 1992[3] Yes N/A POSIX N/A Yes, if used by configured locale Yes (arbitrary fds) No No N/A
bash (v4.0) POSIX bash, sh 1989[4] Yes GNU, Mac OS X 10.3+ GNU,
Haiku
GPL Yes Yes (arbitrary fds) No No Yes
csh POSIX csh 1978 Yes ? ? BSD No Yes (stdin, out, out+err) No No Yes
tcsh POSIX tcsh, csh 1983[5] Yes FreeBSD, formerly Mac OS X ? BSD Yes Yes (stdin, out, out+err) No No Yes
Scsh POSIX scsh 1994 Yes ? ? BSD-style ? Yes No No Yes
ksh (ksh93t+) POSIX ksh 1983[6][7] Yes AIX, HP-UX OpenSolaris Common Public License Yes Yes (arbitrary fds) No No Yes
pdksh POSIX ksh, sh 1989 ? Yes OpenBSD[8] OpenBSD[8] Public Domain No Yes (arbitrary fds) No No Yes
zsh POSIX zsh 1990 Yes Grml, Gobolinux Grml BSD-style Yes Yes (arbitrary fds) No No Yes
ash POSIX sh 1989 Yes Minix, BusyBox based systems FreeBSD, NetBSD, Minix, BusyBox based systems BSD-style Yes Yes (arbitrary fds) No No Yes
Windows
cmd.exe[9]
Win32 cmd 1993 No Windows NT, 2000, XP, Server 2003, Vista Windows NT, 2000, XP, Server 2003, Vista MS-EULA[10] Yes Yes No No Yes
TCC (formerly 4NT) Win32 ? 1993 No ? ? Shareware Yes Yes (stdin, out, err) No No No
Windows PowerShell .NET powershell 2006 No
(3rd party in dev[11])
Windows Server 2008, 7, Vista, XP[12] Windows Server 2008, 7 MS-EULA[10]
or BSD/GPL (PASH)
Yes Yes Yes Yes No
COMMAND.COM DOS command 1980 No
(3rd party available[13])
DOS, Windows 95, 98, ME DOS, Windows 95, 98, ME MS-EULA[14]
or BSD/GPL (free clones)
No Yes (stdin, out, COMn/LPT only) No No Yes
4DOS DOS ? 1989 No ? ? MIT License, with restrictions No Yes (stdin, out, err) No No No
OS/2
cmd.exe
OS/2 cmd 1987 No OS/2 OS/2 IBM-EULA[15] No Yes (stdin, out, err) No No ?
rc Plan 9, POSIX rc 1989 Yes Plan 9, Version 10 Unix Plan 9, Version 10 Unix Lucent Public License Yes Yes No No Yes
BeanShell Java ? 2005 Yes ? ? LGPL Yes Yes ? No Yes (bsh.jar)
Python shell Python python, ipython 1991 Yes ? ? Python Yes Yes ? No Yes on Windows via py2exe
Ruby shell Ruby irb 1995 Yes ? ? Ruby, BSD 1.9: Yes
1.8: limited
Yes ? No Yes with rubyscript2exe.rb
VMS DCL[16] OpenVMS ? 1977 ? No VMS VMS ? No Yes (sys$input, sys$output assignment) No No No

[edit] Interactive features

Completion Directory stack (pushd/popd) Directory History Window (popup) Implicit Directory Change - If command is dir name changes to it Command history History completion Spell checking Default user prompt[17] Custom command prompt Aliases Binary prefix notation Job control Startup scripts
Bourne shell No No No No No No No Yes (variable: $PS1) No No No Yes
POSIX shell No No No No Yes No No Yes (variable: $PS1) Yes No Yes Yes
bash (v4.0) Yes (extendable) Yes No Yes
(optional)
Yes Yes No bash-<version number>$ Yes (variable: $PS1) Yes No Yes Yes
csh Yes (via the ESC key) Yes No Yes
(optional)
Yes Yes No % Yes (variable: $prompt Yes No Yes Yes
tcsh Yes (extendable) Yes No Yes
(optional)
Yes Yes experimental > Yes (variable: $prompt Yes No Yes Yes
Scsh No No No No No No No > No Yes (macro and procedure definitions) Yes Yes Yes
ksh (ksh93t+) Yes (extendable) No No No Yes Yes No $ Yes (variable: $PS1, and more) Yes No Yes Yes
pdksh Yes No No No Yes ? No $ Yes (variable: $PS1) Yes No Yes Yes
zsh Yes (extendable) Yes No Yes
(optional)
Yes Yes Yes <hostname>% Yes (variable: $PS1, and more) Yes No Yes Yes
ash No Yes No No Yes Yes No $ Yes (variable: $PS1) Yes No Yes Yes
Windows
cmd.exe
Yes (partial) Yes No No Yes (F7) Yes (F8) No <path>> Yes (environment variable: %PROMPT%) Yes ("macros", via doskey) No No Yes
TCC (formerly 4NT) Yes (partial) Yes Yes Yes Yes Yes No [<path>] Yes (environment variable: %PROMPT) Yes ? No Yes (4start)
Windows PowerShell Yes (extendable) Yes (all location types)[18] Yes No Yes Yes (F8) No PS <path> Yes (function: prompt) Yes Yes Yes Yes
COMMAND.COM No No No No No[19][20] No[19][20] No <path or drive name>> Yes (environment variable: %PROMPT%) Yes (using SET or registry) No No No[21]
4DOS Yes Yes Yes Yes Yes Yes No <path>> Yes (environment variable: %PROMPT) Yes ? No Yes (4start)
OS/2
cmd.exe
Yes ? No No Yes ? No [<path>] Yes (environment variable: %PROMPT%) No No No No
rc Yes[22] ? No No Yes[22] Yes[22] No term%, ; Yes (function: prompt, or variable: $prompt) Yes (functions) No Handled by rio Yes
BeanShell Yes ? No No Yes ? No bsh % Yes (variable: bsh.prompt, or method: getBshPrompt()) ? ? ? Yes (.bshrc)
Python shell Yes (provided by the rlcompleter module or IPython) Yes (provided by IPython) No No Yes Yes (provided by IPython) No >>> Yes (variable: sys.ps1) Yes (functions) ? Yes Yes ($PYTHONSTARTUP or ipythonrc)
Ruby shell Yes Yes (pass a block to Dir.chdir() method) No No Yes Yes (with UtilityBelt gem) No irb(main):001:0> Yes Yes ? Yes Yes (.irbrc)
VMS DCL No No No No Yes No No $ Yes (SET PROMPT command) Yes Yes Yes Yes (login.com)

[edit] Programming features

Functions Exception handling Search and replace on variables Parallel assignment Variadic functions Default arguments Named parameters Lambda functions eval function Pseudorandom number generation Bytecode
Bourne shell No Yes (via trap) No No No No No No Yes No No
POSIX shell Yes Yes (via trap) No No Yes No No No Yes No No
bash (v4.0) Yes Yes (via trap) Yes (via ${//} syntax) No Yes Yes No No Yes Yes ($RANDOM) No
csh No No No No No No No No Yes No No
tcsh No No Yes (via ${:s//} syntax No No No No No Yes No No
Scsh Yes ? Yes (via string functions and regular expressions) No Yes No No Yes Yes Yes (random-integer, random-real) Yes (compiler is Scheme48 virtual machine, "scshvm")
ksh (ksh93t+) Yes Yes (via trap) Yes (via ${//} syntax and builtin commands) ? Yes Yes Yes (for user-defined "types") No Yes Yes ($RANDOM) Yes (compiler is called "shcomp")
pdksh Yes Yes (via trap) No ? Yes Yes No No Yes Yes ($RANDOM) No
zsh Yes Yes Yes (via ${:s//} and ${//} syntax) ? Yes Yes No No Yes Yes ($RANDOM) Yes (built-in command "zcompile")
ash Yes Yes (via trap) No No Yes Yes No No Yes No No
Windows
cmd.exe
Yes (via "call :label") No Yes (via set %varname:expression syntax) No No No No No No Yes (%random%) No
TCC (formerly 4NT) Yes No Yes (via %@replace[ ] function) No No No No No Yes Yes (%@random[ ] function) No
Windows PowerShell Yes Yes Yes (-replace operator) Yes Yes Yes Yes Yes Yes Yes Yes, automatic
COMMAND.COM No No No No No No No No No No No
4DOS Yes No Yes (via %@replace[ ] function) No ? No ? No Yes Yes (%@random[ ] function) No
OS/2
cmd.exe
No No No No No No No No No No No
rc Yes Yes No ? Yes Yes ? No Yes No No
BeanShell Yes Yes ? ? No No No No Yes Yes Yes
Python shell Yes Yes Yes (via string methods and regular expressions) Yes Yes Yes Yes Yes Yes Yes Yes (standard CPython, IronPython or Jython)
Ruby shell Yes Yes Yes (via string functions and regular expressions) Yes Yes Yes Yes Yes Yes Yes Yes (NetRuby, JRuby, version 1.9/YARV)
VMS DCL Yes Yes No No No No No No No No No

[edit] String and filename matching

Pattern Matching (regular expressions built-in) Pattern Matching (globbing) Globbing qualifiers (filename generation based on file attributes) Recursive globbing (generating files from any level of subdirectories)
Bourne shell No Yes (*, ?, [...]) No No
POSIX shell No Yes (*, ?, [...]) No No
bash (v4.0) Yes Yes (*, ?, [...], {...}) No Yes (**/...)
csh No Yes No No
tcsh Yes Yes No No
Scsh Yes Yes No No
ksh (ksh93t+) Yes Yes (*, ?, [...]) No Yes (with set -G, no following of symlinks)
pdksh No Yes No No
zsh Yes Yes (*, ?, [...],
ext'd globbing[23])
Yes Yes (**/... or ***/... to follow symlinks)
ash No Yes No No
Windows
cmd.exe
Yes (via the findstr /r command) Yes (*, ?) ? No
TCC (formerly 4NT) Limited support Yes (*, ?, [...]) ? Yes (via FOR /R)
Windows PowerShell Yes (full regex support)[24] Yes (*, ?, [...]) ? ?
COMMAND.COM No Yes (*, ?) ? No
4DOS No Yes (*, ?, [...]) ? Yes (via FOR /R)
OS/2
cmd.exe
No Yes (*, ?) ? ?
rc No Yes No No
BeanShell Yes ? ? ?
Python shell Yes Yes Yes (via glob module) Yes (via glob module)
Ruby shell Yes Yes (via Dir.glob() method) ? Yes (via Dir.glob() method)
VMS DCL No Yes No Yes (via [SUBDIR...] )

[edit] Inter-process communication

Pipes Command substitution Process substitution Subshells TCP/UDP connections as streams
Bourne shell bytes
concurrent
Yes No Yes No
POSIX shell bytes
concurrent
Yes No Yes No
bash (v4.0) bytes
concurrent
Yes Yes (if system supports /dev/fd/<n> or named pipes Yes Yes (client only)
csh bytes
concurrent
Yes No Yes No
tcsh bytes
concurrent
Yes No Yes No
Scsh text ? ? ? Yes
ksh (ksh93t+) bytes
(may contain serialized objects if print -C is used)
concurrent
Yes ($(...) and ${<space>...;}) Yes (if system supports /dev/fd/<n> Yes Yes (and SCTP support, client only)
pdksh bytes
concurrent
Yes No Yes No
zsh bytes
concurrent
Yes Yes Yes Yes (client and server but only TCP)
ash bytes
concurrent
Yes No Yes No
Windows
cmd.exe
text
concurrent
Yes (via FOR /F command) No Yes (Backtick: ` in for /f usebackq) No
TCC (formerly 4NT) text Yes (via FOR /F command) ? Limited, via %@execstr[ ] and %@exec[ ] No
Windows PowerShell objects
concurrent
Yes No Yes Yes
COMMAND.COM text
sequential
temporary files
No No No No
4DOS text
sequential
temporary files
Yes (via FOR /F command) ? Limited, via %@execstr[ ] and %@exec[ ] No
OS/2
cmd.exe
text
concurrent
No No ? No
rc text
concurrent
Yes Yes (via: <{cmd} if system supports /dev/fd/<n>) Yes No
BeanShell not supported ? ? ? Yes
Python shell objects (when using IPython+IPipe) Yes Yes (via subprocess module) Yes Yes
Ruby shell not supported Yes Yes Yes (Backtick: `) Yes
VMS DCL text
(via PIPE command)
No No Yes (spawn) Yes (server TCP only)

[edit] References

  1. ^ Now available under a BSD-style license through the Unix Heritage Society and others.
  2. ^ IEEE (6 December 2001). 1003.1™ Standard for Information Technology — Portable Operating System Interface (POSIX®): Shell and Utilities, Issue 6. 
  3. ^ As part of IEEE Std.1003.2-1992 (POSIX.2); integrated into IEEE Std.1003.1 with the 2001 revision.
  4. ^ Brian Fox (forwarded by Leonard H. Tower Jr.) (Jun 7 1989). "Bash is in beta release!". gnu.announce. (Web link). Retrieved Oct 28 2010. 
  5. ^ Ken Greer (Oct 3 1983). "C shell with command and filename recognition/completion". net.sources. (Web link). Retrieved Dec 29 2010. 
  6. ^ Ron Gomes (Jun 9 1983). "Toronto USENIX Conference Schedule (tentative)". net.usenix. (Web link). Retrieved Dec 29 2010. 
  7. ^ Guy Harris (Oct 10 1983). "csh question". net.flame. (Web link). Retrieved Dec 29 2010. 
  8. ^ a b Default shell in OpenBSD is ksh (pdksh).
  9. ^ Command extensions enabled, or "cmd /x".
  10. ^ a b Windows component — covered by a valid license for Microsoft Windows
  11. ^ PASH, a third-party remake, is in development and almost half-finished. Activity seems to have stagnated early 2009.
  12. ^ Windows PowerShell is installed with Windows 7, however, it is an optional download for users of Windows Vista or Windows XP.
  13. ^ Third-party re-implementations, such as DosBox, Wine, and FreeDOS are available.
  14. ^ MS-DOS and Windows component — covered by a valid license for MS-DOS or Microsoft Windows
  15. ^ OS/2 component — covered by a valid license for OS/2
  16. ^ "HP OpenVMS DCL Dictionary". http://h71000.www7.hp.com/doc/732final/9996/9996pro_contents.html. Retrieved 2009-03-23. 
  17. ^ Many shells in *nix environments change the root user's prompt to '#'.
  18. ^ PowerShell exposes more than just the file system as a navigable system: Windows Registry, functions, aliases, variables, certificate store, credential store etc. The location types are extensible through a provider architecture. Common commands will work with any compliant provider
  19. ^ a b Added by TSR programs such as DOSKey
  20. ^ a b Available in DR-DOS via the "history" command in config.sys; see this link
  21. ^ Limited support via AUTOEXEC.BAT.
  22. ^ a b c Handled by rio, GNU readline, editline or vrl
  23. ^ Zsh offers an almost overwhelming variety of globbing options.
  24. ^ PowerShell leverages the full .NET regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.

[edit] External links

Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export