Sie sind auf Seite 1von 9

Comparison of command shells

Comparison of command shells


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

General characteristics
Usual environment Usually invoked Introduced Platform-independent Default login Default script shell in shell in License Unicode Stream Native support Blocking of unsigned scripts available as statically linked, independent single file executable Bourne shell 7th Ed. UNIX sh 1977 Yes 7th Ed. UNIX 7th Ed. UNIX Yes Yes (arbitrary fds) POSIX shell No No Yes redirection CIM/WBEM

[1][2]

Proprietary, CDDL

[3][4]

[5]

POSIX

sh

1992

[6]
Yes

N/A

POSIX

N/A

Yes, if used by configured locale

Yes (arbitrary fds) Yes No No

N/A

bash (v4.0)

POSIX

bash, sh

1989

[7]
Yes

GNU, Mac OS X 10.3+

GNU, Haiku

GPL 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

[8]
Yes

FreeBSD, formerly Mac OS X

BSD Yes

Yes (stdin, out, out+err) No No Yes

Scsh ksh (ksh93t+)

POSIX POSIX

scsh ksh

1994 1983

Yes

? AIX, HP-UX

? OpenSolaris

BSD-style Common Public License

Yes Yes

No

No

Yes

[9][10]
Yes

Yes

(arbitrary fds)

No

No

Yes

pdksh

POSIX

ksh, sh

1989 ? Yes

OpenBSD

[11]

OpenBSD

[11] 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

Win32

cmd

1993 No

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

[12]

MS-EULA

[13]
Yes Yes No No Yes

TCC (formerly 4NT)

Win32

1993

No

Shareware

Yes

Yes (stdin, out, err)

No

No

No

Comparison of command shells


[13]
Yes Yes Yes Yes

2
Windows Server 2008, 7

Windows PowerShell

.NET

powershell

2006 No (3rd party in dev

Windows

MS-EULA

[14]

Server 2008, ) 7, Vista, XP

or BSD/GPL (PASH)

No

[15]

COMMAND.COM

DOS

command

1980 No (3rd party available

DOS, Windows 95, 98, ME ) ?

DOS, Windows 95, 98, ME

MS-EULA

[17]
No

Yes (stdin, out, COMn/LPT only) No No Yes

or BSD/GPL (free clones)

[16]

4DOS

DOS

1989

No

MIT License, with restrictions

No

Yes (stdin, out, err) Yes (stdin, out, err)

No

No

No ?

OS/2 cmd.exe rc

OS/2

cmd

1987

No

OS/2

OS/2

IBM-EULA

[18]

No

No

No

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 Python shell

Java Python

? python, ipython

2005 1991

Yes

? ?

LGPL Python

Yes

Yes

? ?

No

Yes (bsh.jar) Yes on

Yes

Yes

Yes

No

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

[19]

OpenVMS

1977 ? No

VMS

VMS

? No

Yes (sys$input, sys$output assignment) No No No

Interactive features
Completion Directory stack Directory Implicit History Directory Change If command is dir name changes to it Bourne shell No No No No No No No $ Yes (variable: $PS1) $ Yes (variable: $PS1) bash-<version number>$ % Yes (variable: $PS1) Yes (variable: $prompt > Yes (variable: $prompt Via functions Yes No Since SVr4 Yes Yes (popup) Command history History completion Spell checking Default user prompt Custom command prompt Aliases Binary prefix notation Job control Startup scripts

[20]

(pushd/popd) Window

POSIX shell

No Yes (extendable)

No

No

No Yes (optional) Yes (optional) Yes (optional)

Yes

No

No

No

Yes

bash (v4.0)

Yes

No

Yes

Yes

No

Yes

No

Yes

Yes

csh

Yes (via the ESC key)

Yes

No

Yes

Yes

No

Yes

No

Yes

Yes

tcsh

Yes (extendable)

Yes

No

Yes

Yes

experimental

Yes

No

Yes

Yes

Comparison of command shells

3
> Yes No (macro and procedure definitions) Yes Yes Yes

Scsh No No No No No No No

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)

<hostname>% Yes Yes Yes

Yes (variable: $PS1, and more) Yes No Yes Yes

ash

No

Yes

No

No

Yes

Yes

No

Yes (variable: $PS1)

Yes Yes via doskey)

No

Yes

Yes

Windows cmd.exe Yes (partial) Yes No No Yes (F7) Yes (F8) No

<path>>

Yes variable: %PROMPT%)

(environment ("macros",

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) Yes No Yes Yes (F8) No

PS <path>> Yes (function: prompt) Yes Yes Yes Yes

[21]
<path or drive

COMMAND.COM No No No No No

Yes (environment variable: %PROMPT%)

[22][23]

No

[22][23]

No

name>>

Yes (using SET or registry) ? Yes No Yes (4start) No No No

[24]

4DOS Yes Yes Yes Yes Yes Yes No

<path>>

Yes (environment variable: %PROMPT)

OS/2 cmd.exe Yes

? No No Yes

? No

[<path>]

Yes (environment variable: %PROMPT%) No No No No

rc Yes

term%, ; No No Yes

Yes (function: prompt, or variable: $prompt) Yes (functions) No

Handled by rio Yes

[25]

[25]

Yes

[25]

No

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)

Comparison of command shells

4
irb(main):001:0> No Yes Yes ? Yes Yes (.irbrc)

Ruby shell Yes

Yes (pass a block to Dir.chdir method) No No Yes

Yes (with UtilityBelt gem)

VMS DCL No No No No Yes No No

Yes (SET PROMPT command) Yes Yes Yes Yes (login.com)

Programming features
Functions Exception Search and replace Parallel Variadic Default Named Lambda eval Pseudorandom Bytecode handling on variables assignment functions arguments parameters functions function number generation Bourne shell Yes since SVr2 Yes Yes (via trap) Yes (via trap) Yes (via trap) No No ? Yes (via string functions and regular expressions) No No Since SVr2 Yes No No No Yes No No

POSIX shell

No Yes (via ${//} syntax) No Yes (via ${:s//} syntax

No

No

No

No

Yes

No Yes ($RANDOM) No No

No

bash (v4.0)

Yes No No

No No No

Yes No No

Yes No No

No No No

No No No

Yes Yes Yes

No No No

csh tcsh

Scsh

Yes

No

Yes

No

No

Yes

Yes

Yes (compiler Yes is (random-integer, Scheme48 random-real) virtual machine, "scshvm") Yes (compiler is called "shcomp") No Yes (built-in command "zcompile") No

ksh (ksh93t+) Yes Yes (via trap)

Yes (via ${//} syntax and builtin commands)

? Yes Yes

Yes (for user-defined "types")

No

Yes

Yes ($RANDOM)

pdksh

Yes

Yes (via trap)

No

Yes

Yes

No

No

Yes

Yes ($RANDOM)

zsh Yes Yes Yes (via ${:s//} and ${//} syntax)

? Yes Yes No No Yes Yes ($RANDOM)

ash

Yes Yes (via "call :label")

Yes (via trap)

No Yes (via set %varname:expression syntax) Yes (via %@replace[] function) Yes (-replace operator)

No

Yes

Yes

No

No

Yes

No

Windows cmd.exe

No

No

No

No

No

No

No

Yes (%random%) Yes (%@random[] function) Yes

No

TCC (formerly 4NT)

Yes

No

No

No

No

No

No

Yes

No

Windows PowerShell

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes, automatic

Comparison of command shells

5
No Yes (via %@replace[] function) No No ? No No ? No No No No ? No Yes No No No Yes (%@random[] function) No No Yes No

COMMAND.COM 4DOS

No

No

Yes

No

No

OS/2 cmd.exe rc BeanShell Python shell

No Yes Yes

No Yes Yes

No ? ?

No Yes No

No Yes No

No ? No

No No No

No Yes Yes

No No Yes Yes (standard CPython, IronPython or Jython) Yes (NetRuby, JRuby, version 1.9/YARV) No

Yes

Yes

Yes (via string methods and regular expressions)

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Ruby shell Yes Yes Yes (via string functions and regular expressions) Yes Yes Yes Yes Yes Yes Yes

VMS DCL

Yes

Yes

No

No

No

No

No

No

No

No

String and filename matching


Pattern Matching (regular expressions built-in) Bourne shell POSIX shell bash (v4.0) csh tcsh Scsh ksh (ksh93t+) No No Yes No Yes Yes Yes No Yes ash Windows cmd.exe TCC (formerly 4NT) Windows PowerShell COMMAND.COM 4DOS No Yes (via the findstr /r command) Limited support Pattern Matching (globbing) Globbing qualifiers (filename generation based on file attributes) No No No No No No No No Yes No ? Recursive globbing (generating files from any level of subdirectories) No No Yes (**/...) No No No Yes (with set -G, no following of symlinks) No Yes (**/... or ***/... to follow symlinks) No No

Yes (*, ?, [...]) Yes (*, ?, [...]) Yes (*, ?, [...], {...}) Yes Yes Yes Yes (*, ?, [...]) Yes Yes (*, ?, [...], [26] ext'd globbing ) Yes Yes (*, ?)

pdksh zsh

Yes (*, ?, [...])

Yes (via FOR /R) ?

Yes (full regex [27] support) No No

Yes (*, ?, [...]) Yes (*, ?) Yes (*, ?, [...]) ? ? No Yes (via FOR /R)

Comparison of command shells

6
? ?

OS/2 cmd.exe rc BeanShell Python shell Ruby shell

No No Yes Yes Yes No

Yes (*, ?) Yes ? Yes Yes (via Dir.glob method) Yes

No ? Yes (via glob module) ?

No ? Yes (via glob module) Yes (via Dir.glob method) Yes (via [SUBDIR...] )

VMS DCL

No

Inter-process communication
Pipes Command substitution Process substitution Subshells TCP/UDP connections as streams No

Bourne shell

bytes concurrent bytes concurrent bytes concurrent bytes concurrent bytes concurrent text bytes (may contain serialized objects if print -C is used) concurrent bytes concurrent bytes concurrent bytes concurrent text concurrent

Yes

No

Yes

POSIX shell

Yes

No Yes (if system supports /dev/fd/<n> or named pipes No

Yes

No

bash (v4.0)

Yes

Yes

Yes (client only)

csh

Yes

Yes

No

tcsh

Yes ?

No ?

Yes ?

No Yes

Scsh ksh (ksh93t+)

Yes ($(...) and ${<space>...;})

Yes (if system supports /dev/fd/<n>

Yes

Yes (and SCTP support, client only)

pdksh

Yes

No

Yes

No Yes (client and server but only TCP) No

zsh

Yes

Yes

Yes

ash

Yes Yes (via FOR /F command) Yes (via FOR /F command)

No

Yes Yes (Backtick: ` in for /f usebackq) Limited, via %@execstr[] and %@exec[] Yes

Windows cmd.exe TCC (formerly 4NT)

No ?

No

text

No

Windows PowerShell COMMAND.COM

objects concurrent text sequential temporary files

Yes

No

Yes

No

No

No

No

Comparison of command shells

7
? Limited, via %@execstr[] and %@exec[] ?

4DOS

text sequential temporary files text concurrent text concurrent not supported objects (when using IPython+IPipe) not supported text (via PIPE command)

Yes (via FOR /F command)

No

OS/2 cmd.exe rc

No

No Yes (via: <{cmd} if system supports /dev/fd/<n>) ? Yes (via subprocess module) Yes No

No

Yes

Yes

No

BeanShell Python shell

? Yes Yes No

? Yes Yes (Backtick: `) Yes (spawn)

Yes Yes Yes Yes (server TCP only)

Ruby shell VMS DCL

References
[1] A platform independent version (http:/ / www. collyer. net/ who/ geoff/ v7sh. tar) based on the historical UNIX V7 original source code is available from Geoff Collyer (http:/ / www. collyer. net/ who/ geoff/ ) [2] A platform independent version (ftp:/ / ftp. berlios. de/ pub/ schily/ ) based on the SVr4/Solaris source code is available from Jrg Schilling [3] The historic UNIX V7 version is available under a BSD-style license (http:/ / minnie. tuhs. org/ Archive/ Caldera-license. pdf) through the Unix Heritage Society and others. [4] The SVr4 (OpenSolaris) version http:/ / src. opensolaris. org/ source/ xref/ onnv/ onnv-gate/ usr/ src/ cmd/ sh/ is available under CDDL, older versions (except UNIX V7) are available under a AT&T proprietray license. However, most extent versions (AIX, IRIX64, HPUX, Tru64) remain under AT&T licence. [5] IEEE (6 December 2001). 1003.1 Standard for Information Technology Portable Operating System Interface (POSIX): Shell and Utilities, Issue 6. [6] As part of IEEE Std.1003.2-1992 (POSIX.2); integrated into IEEE Std.1003.1 with the 2001 revision. [7] Brian Fox (forwarded by Leonard H. Tower Jr.) (7 June 1989). "@wheat-chex.ai.mit.edu Bash is in beta release! (news:8906080235. AA01983)". [news:gnu.announce gnu.announce]. (Web link) (http:/ / groups. google. com/ group/ gnu. announce/ msg/ a509f48ffb298c35?hl=en). Retrieved 28 October 2010. [8] Ken Greer (3 October 1983). "C shell with command and filename recognition/completion". [news:net.sources net.sources]. (Web link) (http:/ / groups. google. com/ group/ net. sources/ msg/ 7073bf41cc5da330?hl=en). Retrieved 29 December 2010. [9] Ron Gomes (9 June 1983). "Toronto USENIX Conference Schedule (tentative)". [news:net.usenix net.usenix]. (Web link) (http:/ / groups. google. com/ group/ net. usenix/ msg/ fa6e1f7de3b63bba?hl=en). Retrieved 29 December 2010. [10] Guy Harris (10 October 1983). "csh question". [news:net.flame net.flame]. (Web link) (http:/ / groups. google. com/ group/ net. flame/ msg/ 4f868085b65af530?hl=en). Retrieved 29 December 2010. [11] Default shell in OpenBSD (http:/ / www. openbsd. org/ faq/ faq10. html#rootshell) is ksh (pdksh). [12] Command extensions enabled, or "cmd /x". [13] Windows component covered by a valid license for Microsoft Windows [14] PASH, a third-party remake, is in development and almost half-finished (http:/ / pash. sourceforge. net/ ). Activity seems to have stagnated (http:/ / igorshare. wordpress. com/ 2008/ 04/ 06/ pash-cross-platform-powershell-is-out-in-the-wild-announcement/ #comment-456) early 2009 (https:/ / launchpad. net/ pash/ + announcement/ 1912). [15] Windows PowerShell is installed with Windows 7, however, it is an optional download for users of Windows Vista or Windows XP. [16] Third-party re-implementations, such as DosBox, Wine, and FreeDOS are available. [17] MS-DOS and Windows component covered by a valid license for MS-DOS or Microsoft Windows [18] OS/2 component covered by a valid license for OS/2 [19] "HP OpenVMS DCL Dictionary" (http:/ / h71000. www7. hp. com/ doc/ 732final/ 9996/ 9996pro_contents. html). . Retrieved 23 March 2009. [20] Many shells in *nix environments change the root user's prompt to '#'. [21] 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 [22] Added by TSR programs such as DOSKey

Comparison of command shells


[23] Available in DR-DOS via the "history" command in config.sys; see this link (http:/ / www. drdos. com/ dosdoc/ usergeng/ 09ugch9. htm#1309) [24] Limited support via AUTOEXEC.BAT. [25] Handled by rio, GNU readline, editline or vrl [26] Zsh offers an almost overwhelming variety of globbing options (http:/ / zsh. sourceforge. net/ Guide/ zshguide05. html#l135). [27] PowerShell leverages the full .NET regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.

External links
Linux Magazine: Bash vs. Vista PowerShell (http://w3.linux-magazine.com/issue/78/Bash_vs. _Vista_PowerShell.pdf) IEEE. 1003.1 Standard for Information Technology Portable Operating System Interface (POSIX): Shell and Utilities, Issue 7 (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html)

Article Sources and Contributors

Article Sources and Contributors


Comparison of command shells Source: http://en.wikipedia.org/w/index.php?oldid=500004822 Contributors: 121a0012, Ahy1, Albing, Alfps, Apotheon, Beavermania3354, Blanford robinson, Boaf, Booch, Buhman, Bukzor, Carpetsmoker, Catena, Charles dye, Chealer, Chowbok, Claunia, Csant, CyberSkull, DenisKrivosheev, Djholl, Doctor J, Donhalcon, Drknkn, Drpickem, Dum8d0g, Dustin Howett, ENeville, EncMstr, Exidor, Falcotron, Flanakin, Francis abraham, FutureDomain, Gaius Cornelius, Ghettoblaster, Gisburn, Grawity, Gudeldar, Gustavb, H2g2bob, Harryboyles, Helpsloose, Hgrosser, Infofarmer, Jacj, Janizary, Jfultz, Jonsafari, Jsnover, Justinchudgar, Kaiserkarl13, Kappa, Kesla, Lambiam, Lost.goblin, Mbell, Mcpusc, Mfarah, Minghong, Mkgardner, Msnicki, Nealmcb, Newmanbe, OMouse, Ohconfucius, P0lyglut, PSIplus, Pabouk, R'n'B, Raucanum, Repelsteeltje, RexNL, S1kjreng, Schily, Scientus, Sietse Snel, Simxp, SquidInc, Stephane Chazelas, Steppres, Takeshita kenji, Tedickey, The LMOE, Tomgibbons, Trasz, Unimath, Unixguy, Useerup, Weenie1, Wermlandsdata, Wfaulk, Whiteknox, Whitis, Ysangkok, ZZyXx, Zeus, Zoney, Zxcvbnm, , 195 anonymous edits

License
Creative Commons Attribution-Share Alike 3.0 Unported //creativecommons.org/licenses/by-sa/3.0/

Das könnte Ihnen auch gefallen