Anonymous user
Category:UNIX Shell Implementations: Difference between revisions
Category:UNIX Shell Implementations (view source)
Revision as of 05:26, 30 March 2008
, 16 years agoFixed a few spelling mistakes and readability
No edit summary |
(Fixed a few spelling mistakes and readability) |
||
Line 3:
There are many [[UNIX Shell|UNIX Shells]] and most of them can be categorized into two families. For purposes of the Rosette Code, all examples are in Bourne-compatible syntax. The other family of shells, with a markedly different syntax, are ''csh'' and it's ''tcsh'' (Tenex C Shell) "clone." Common Bourne compatible shells include the original [[Bourne Shell]] (''/bin/sh'' on most versions of UNIX), the GNU [[Bourne Again SHell]] (''bash'' --- which is linked to ''/bin/sh'' on many distributions of [[Linux]], making it their default shell), the [[Korn Shell]] (''ksh''), the [[Public Domain Korn SHell]] (''pdksh''), the [[Almquist SHell]] (''ash'') and the [[Debian Almquist SHell]] (''dash'') and the [[Z SHell]] (''zsh'').
The original Bourne shell went through a number of revisions in the early years of UNIX, and support for some features varies considerably. By the time the SUSv3 (Single Unix Specification, version 3) features
Note that even when using a common subset of supported features there are subtle implementation differences, and in some cases parsing bugs, which can affect the portability of shell script examples. For example in ''bash''
{ echo foo; echo bar } ## Bug!!!
... though this is technically a bug in the language parsing (The braces used for command grouping are not delimiters in the same class as semicolons nor parentheses; so this example is ambiguous because ''echo }'' (outside of any command grouping) should work the same as ''echo "}"'' --- but in bash versions 1.x it
{ echo foo; echo bar; } ## Note the required semicolon
|