Category:UNIX Shell Implementations: Difference between revisions

m
→‎Comparison table: Use nowiki tags for a literal [[
(I chose this spot to insert a comparison table.)
m (→‎Comparison table: Use nowiki tags for a literal [[)
 
(5 intermediate revisions by one other user not shown)
Line 16:
 
=== Comparison table ===
{| class="wikitable sortable"
! Feature
! Bourne ''sh''
! ''ash, dash''
!
*! ''ashpdksh, mksh''
* ''dash''
!
* ''pdksh''
* ''mksh''
! ''bash''
|-
Line 36 ⟶ 32:
* [http://www.mirbsd.org/htman/i386/man1/mksh.htm mksh]
| [http://man.cx/bash bash]
|-
| <tt> `''command''`</tt>
| {{yes}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>''func''() { ''list''; }</tt>
| {{yes}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>[ -n "$''param''" ]</tt>
| {{yes}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>''PARAM''=''value''<br />export ''PARAM''</tt>
| {{yes}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>export ''PARAM''=''value''</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>local ''param''</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>${''param''##*/}<br />${''param''%/*}</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>ls ~</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>$(''command'')</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>$(( ''i = 2 + 3'' ))</tt>
| {{no}}
| {{yes}}
| {{yes}}
| {{yes}}
|-
| <tt>(( ''i = 2 + 3'' ))</tt>
| {{no}}
| {{no}}
| {{yes}}
| {{yes}}
|-
| <tt><nowiki>[[</nowiki> -n $''param'' ]]</tt>
| {{no}}
| {{no}}
| {{yes}}
| {{yes}}
|-
| <tt>function ''name'' { ''list''; }</tt>
| {{no}}
| {{no}}
| {{yes}}
| {{yes}}
|-
| <tt>${''array''[''2'']}</tt>
| {{no}}
| {{no}}
| {{yes}}
| {{yes}}
|-
| <tt>set -A ''array 11 22 33''</tt>
| {{no}}
| {{no}}
| {{yes}}
| {{no}}
|-
| <tt>''array''=(''11 22 33'')</tt>
| {{no}}
| {{no}}
| {{optional|mksh}}
| {{yes}}
|-
| <tt>$' \t\n'</tt>
| {{no}}
| {{no}}
| {{optional|mksh}}
| {{yes}}
|}
 
Adding more rows to the table...
 
=== Portability notes ===
Line 80 ⟶ 176:
 
==Comparison of various shells==
[http://athenawww.vvsumath.ruiitb.ac.in/resources/docsmanuals/unixUnix_Unleashed/unix_admVol_1/ch13.htm An excerpt] from "UNIX Unleashed, System Administrator's Edition", has a decent discussion of how to choose a shell. The article focuses on three areas: command line usage, shell scripting for personal use and shell scripting for others to use.