Category:UNIX Shell Implementations: Difference between revisions
Content added Content deleted
(I chose this spot to insert a comparison table.) |
(→Comparison table: Fill in the table for sh, ash, pdksh and bash.) |
||
Line 19: | Line 19: | ||
! Feature |
! Feature |
||
! Bourne ''sh'' |
! Bourne ''sh'' |
||
⚫ | |||
! |
|||
! ''pdksh, mksh'' |
|||
⚫ | |||
! |
|||
* ''pdksh'' |
|||
* ''mksh'' |
|||
! ''bash'' |
! ''bash'' |
||
|- |
|- |
||
Line 36: | Line 32: | ||
* [http://www.mirbsd.org/htman/i386/man1/mksh.htm mksh] |
* [http://www.mirbsd.org/htman/i386/man1/mksh.htm mksh] |
||
| [http://man.cx/bash bash] |
| [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>$(''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>[[ -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 === |
=== Portability notes === |