Comparison of command shells

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search

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

bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL[2]
Usual environment POSIX POSIX POSIX POSIX POSIX POSIX POSIX POSIX Win32 Win32 .NET DOS DOS OS/2 Plan 9, POSIX Java Python Ruby OpenVMS
Introduced 1987 1978 1979 1994 1982 1989 ? 1990 1989 1993 1993 2006 1980 1989 1987 1989 2005 1991 1995 1977 ?
Completion Yes (extendable) Yes (via the ESC key) Yes (extendable) No Yes (extendable) Yes Yes (extendable) No Yes (partial) Yes (partial) Yes (extendable) No Yes Yes Yes[3] Yes Yes (provided by the rlcompleter module or IPython) Yes No
Pipes text
concurrent
text
concurrent
text
concurrent
text text
(may contain serialized objects if print -C is used)
concurrent
text
concurrent
text
concurrent
text
concurrent
text
concurrent
text objects
concurrent
text
sequential
temporary files
text
sequential
temporary files
text
concurrent
text
concurrent
not supported objects (when using IPython+IPipe) not supported text
(via PIPE command)
Integer arithmetic Yes (via $(( )), (( )) and let syntax) Yes (via @ syntax) Yes (via @ syntax) Yes Yes (via $(( )), (( )), let syntax and expr builtin) Yes (via $(( )) syntax) Yes (via $(( )), (( )) and let syntax) Yes [4] Yes (via "set /a") Yes (via %@eval[ ] function) Yes No Yes (via %@eval[ ] function) No No Yes Yes Yes Yes
Typing discipline dynamic
weak
dynamic
weak
dynamic
weak
dynamic
strong
dynamic
weak
dynamic
weak
dynamic
weak
dynamic
weak
dynamic
weak
dynamic
weak
dynamic or static
strong
dynamic
weak
dynamic
weak
dynamic
weak
? dynamic
strong
dynamic
strong
dynamic
strong
dynamic
weak
Floating point arithmetic No No No Yes Yes (including C99-style extensions) No Yes No No Yes (via %@eval[ ] function) Yes No Yes (via %@eval[ ] function) No No Yes Yes Yes No
Date & time arithmetic No No No ? No No No No No Yes Yes No Yes No No Yes Yes Yes Yes
Scientific notation No (except for printf %f/%g) No No Yes Yes (including C99-style base16 notation) No Yes No No Yes[5] Yes No No No No Yes Yes Yes No
Binary prefix notation No No No Yes No No No No No ? Yes No ? No No ? ? ? Yes
Hash tables Yes (via associative arrays) No No Yes (via module) Yes (via associative arrays) No Yes No No No Yes No No No No Yes Yes Yes No
Compound Variables No No No Yes (via records or lists) Yes No ? No No No Yes No No ? ? ? Yes (via tuples) Yes No
Pattern Matching (regular expressions built-in) Yes No Yes Yes Yes No Yes No Yes (via the findstr /r command) Limited support Yes (full regex support)[6] No No No No Yes Yes Yes No
Pattern Matching (globbing) Yes (*, ?, [...]) Yes Yes Yes Yes (*, ?, [...]) Yes Yes (*, ?, [...]) Yes Yes (*, ?) Yes (*, ?, [...]) Yes (*, ?, [...]) Yes (*, ?) Yes (*, ?, [...]) Yes (*, ?) Yes ? Yes Yes (via Dir.glob() method) Yes
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL
Globbing qualifiers (filename generation based on file attributes) No No No No No No Yes No ? ? ? ? ? ? No ? Yes (via glob module) ? No
Recursive globbing (generating files from any level of subdirectories) Yes (**/...) No No No Yes (with set -G, no following of symlinks) No Yes (**/... or ***/... to follow symlinks) No No Yes (via FOR /R) ? No Yes (via FOR /R) ? No ? Yes (via glob module) Yes (via Dir.glob() method) Yes (via [SUBDIR...] )
Directory stack (pushd/popd) Yes Yes Yes No No ? Yes ? Yes Yes Yes (all location types)[7] No Yes ? ? ? Yes (provided by IPython) Yes (pass a block to Dir.chdir() method) No
Directory History Window (popup) No No No No No No No No No Yes Yes No Yes No No No No No No
Implicit Directory Change - If command is dir name changes to it No
complains command is dir
No No No No No Yes
via setopt AUTOCD
No No Yes No No Yes No No No No No No
Command history Yes Yes Yes No Yes Yes Yes No Yes (F7) Yes Yes No[8][9] Yes Yes Yes[3] Yes Yes Yes Yes
History completion Yes Yes Yes No Yes ? Yes No Yes (F8) Yes Yes (F8) No[8][9] Yes ? Yes[3] ? Yes (provided by IPython) Yes (with UtilityBelt gem) No
Spell checking No No experimental No No No Yes No No No No No No No No No No No No
Default user prompt[10] bash-<version number>$ % > > $ $ <hostname>% $ <path>> [<path>] PS <path> <path or drive name>> <path>> [<path>] term%, ; bsh % >>> irb(main):001:0> $
Custom command prompt Yes (variable: $PS1) Yes (variable: $prompt Yes (variable: $prompt No Yes (variable: $PS1, and more) Yes (variable: $PS1) Yes (variable: $PS1, and more) Yes (variable: $PS1) Yes (environment variable: %PROMPT%) Yes (environment variable: %PROMPT) Yes (function: prompt) Yes (environment variable: %PROMPT%) Yes (environment variable: %PROMPT) Yes (environment variable: %PROMPT%) Yes (function: prompt, or variable: $prompt) Yes (variable: bsh.prompt, or method: getBshPrompt()) Yes (variable: sys.ps1) Yes Yes (SET PROMPT command)
Exception handling Yes (via trap) ? ? ? Yes (via trap) ? Yes Yes (via trap) No No Yes No No No Yes Yes Yes Yes Yes
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL
One-dimensional array variables Yes Yes Yes Yes Yes Yes Yes No No No Yes No No No Yes Yes Yes Yes No
Multi-dimensional array variables No No No Yes Yes (both indexed and associative arrays) No Yes (via associative arrays) No No No Yes No No No Yes Yes Yes Yes No
Array slicing Yes (${var:offset:length} syntax) No No No Yes (${var:offset:length} and [${from}..${to}] syntax) No Yes (${var[from,to]} syntax) No No No Yes No No No Yes ($var(i j k)) No Yes Yes No
Stream redirection Yes (arbitrary fds) Yes (stdin/out/err) Yes (stdin/out/err) Yes Yes (arbitrary fds) Yes (arbitrary fds) Yes (arbitrary fds) Yes (arbitrary fds) Yes Yes (stdin/out/err) Yes Yes (stdin/out/COMn/LPT only) Yes (stdin/out/err) Yes (stdin/out/err) Yes Yes Yes Yes Yes (sys$input, sys$output assignment)
Aliases Yes Yes Yes Yes (macro and procedure definitions) Yes Yes Yes Yes Yes ("macros", via doskey) Yes Yes Yes (using SET or registry) Yes No Yes (functions) ? Yes (functions) Yes Yes
Search and replace on variables Yes (via ${//} syntax) No Yes (via ${:s//} syntax Yes (via string functions and regular expressions) Yes (via ${//} syntax and builtin commands) No Yes (via ${:s//} and ${//} syntax) No Yes (via set %varname:expression syntax) Yes (via %@replace[ ] function) Yes (-replace operator) No Yes (via %@replace[ ] function) No No ? Yes (via string methods and regular expressions) Yes (via string functions and regular expressions) No
Command substitution Yes Yes Yes ? Yes Yes Yes Yes Yes (via FOR /F command) Yes (via FOR /F command) Yes No Yes (via FOR /F command) No Yes ? Yes Yes No
Process substitution Yes (if system supports /dev/fd/<n> or named pipes No No ? Yes (if system supports /dev/fd/<n> No Yes No No ? ? No ? No Yes (via: <{cmd} if system supports /dev/fd/<n>) ? Yes (via subprocess module) Yes No
Quoting Yes Yes Yes No Yes Yes Yes Yes Yes Yes (Backtick: `) Yes No Yes (Backtick: `) ? Yes ? Yes Yes Yes
Escaping Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (Caret: ^) Yes (Caret: ^) Yes (Backtick: `) No Yes (Ctrl-X: ?) Yes Yes Yes (Backslash: \) Yes (Backslash: \) Yes (Backslash: \) Yes (quotes or string assignment)
Parallel assignment No No No No ? ? ? No No No Yes No No No ? ? Yes Yes No
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL
Subshells Yes Yes Yes ? Yes Yes Yes Yes Yes (Backtick: ` in for /f usebackq) Limited, via %@execstr[ ] and %@exec[ ] Yes No Limited, via %@execstr[ ] and %@exec[ ] ? Yes ? Yes Yes (Backtick: `) Yes (spawn)
Job control Yes Yes Yes Yes Yes Yes Yes Yes No No Yes No No No Handled by rio ? Yes Yes Yes
Functions Yes No No Yes Yes Yes Yes Yes Yes (via "call :label") Yes Yes No Yes No Yes Yes Yes Yes Yes
Variadic functions Yes No No Yes Yes Yes Yes Yes No No Yes No ? No Yes No Yes Yes No
Default arguments Yes No No No Yes Yes Yes Yes No No Yes No No No Yes No Yes Yes No
Named parameters No No No No Yes (for user-defined "types") No No No No No Yes No ? No ? No Yes Yes No
Lambda functions No No No Yes No No No No No No Yes No No No No No (lambdas can't have control structures) Yes No
eval function Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes No Yes No Yes Yes Yes Yes No
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL
(De-)Serialization of composite datatypes No No ? No Yes (print -v var, read -C var) No ? No No No Yes No No No ? Yes Yes Yes No
Pseudorandom number generation Yes ($RANDOM) ? ? Yes (random-integer, random-real) Yes ($RANDOM) ? Yes ($RANDOM) ? Yes (%random%) Yes (%@random[ ] function) Yes No Yes (%@random[ ] function) No No Yes Yes Yes No
TCP/UDP connections as streams Yes (client only) No No Yes Yes (and SCTP support, client only) No Yes (client and server but only TCP) No No No Yes No No No No Yes Yes Yes Yes (server TCP only)
Native CIM/WBEM support No No No No No No No No No No Yes No No No No ? ? ? No
Comments Yes (#) Yes (#) Yes (#) Yes (; and #| ... |# for multi-line comments) Yes (#) Yes (#) Yes (#) Yes (#) Yes (rem and unofficially the invalid label ::) Yes (rem and unofficially the invalid label ::) Yes (#); and <# ... #> for multi-line comments Yes (rem and unofficially the invalid label ::) Yes (rem and unofficially the invalid label ::) Yes (rem and unofficially the invalid label ::) Yes (#) Yes (//) Yes (#) Yes (#) Yes (!)
Here documents Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes No No No Yes No Equivalent feature ("""string""" syntax) Yes Yes
Lines without $ in COM file
Unicode Yes No Yes ? Yes No Yes No Yes Yes Yes No No No Yes Yes Yes 1.9: Yes
1.8: limited
No
Startup scripts Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes (4start) Yes No [11] Yes (4start) No Yes Yes (.bshrc) Yes ($PYTHONSTARTUP or ipythonrc) Yes (.irbrc) Yes (login.com)
Blocking of unsigned scripts No No No No No No No No No No Yes No No No No No No No No
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL
Bytecode No No No Yes (compiler is Scheme48 virtual machine, "scshvm") Yes (compiler is called "shcomp") No Yes (built-in command "zcompile") No No No Yes, automatic No No No No Yes Yes (standard CPython, IronPython or Jython) Yes (NetRuby, JRuby, version 1.9/YARV) No
available as statically linked, independent single file executable Yes Yes Yes Yes Yes Yes Yes Yes Yes No No Yes No ? Yes Yes (bsh.jar) Yes on Windows via py2exe No No
Platform-independent Yes Yes Yes Yes Yes Yes Yes Yes No No Yes
via PASH
Yes[12] No No Yes Yes Yes Yes No
License GPL BSD BSD BSD-style Common Public License Public Domain BSD-style BSD-style MS-EULA[13] Shareware MS-EULA[14]
or BSD/GPL (PASH)
MS-EULA[15]
or BSD/GPL (free clones)
MIT License, with restrictions IBM-EULA[16] Lucent Public License LGPL Python Ruby, GPL ?
bash (v4.0) csh tcsh Scsh ksh (ksh93t+) pdksh zsh ash Windows
cmd.exe[1]
4NT Windows PowerShell COMMAND.COM 4DOS OS/2
cmd.exe
rc BeanShell Python shell Ruby shell VMS DCL

References

  1. 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Command extensions enabled, or "cmd /x".
  2. "HP OpenVMS DCL Dictionary". http://h71000.www7.hp.com/doc/732final/9996/9996pro_contents.html. Retrieved 2009-03-23. 
  3. 3.0 3.1 3.2 Handled by rio, GNU readline, editline or vrl
  4. Available in modern versions of ash such as NetBSD's sh or Debian ash
  5. Scientific notation is supported for input only; numeric results are always displayed in common format.
  6. PowerShell leverages the full .NET regular expression engine which features named captures, zero-width lookahead/-behind, greedy/non-greedy, character classes, level counting etc.
  7. 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
  8. 8.0 8.1 Added by TSR programs such as DOSKey
  9. 9.0 9.1 Available in DR-DOS via the "history" command in config.sys; see this link
  10. Many shells in *nix environments change the root user's prompt to '#'.
  11. Limited support via AUTOEXEC.BAT.
  12. Refers only to some implementations, such as on DosBox, Wine, and FreeDOS.
  13. Windows component — covered by a valid license for Microsoft Windows
  14. Windows component — covered by a valid license for Microsoft Windows
  15. MS-DOS and Windows component — covered by a valid license for MS-DOS or Microsoft Windows
  16. OS/2 component — covered by a valid license for OS/2

External links

If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...