ultimate_differences_amongst_unix_shells
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ultimate_differences_amongst_unix_shells [2021/03/09 23:38] – [Conclusion] hc9 | ultimate_differences_amongst_unix_shells [2022/02/07 20:13] (current) – copied over Bash and Zsh sections from html tutorial also cleaned out backticks from html conversion peteyboy | ||
---|---|---|---|
Line 17: | Line 17: | ||
In UNIX history, the Thompson shell preceded both the Bourne shell and the C shell, and its command language is a subset of both of these shells. Control flow in the Thompson shell is implemented via [[http:// | In UNIX history, the Thompson shell preceded both the Bourne shell and the C shell, and its command language is a subset of both of these shells. Control flow in the Thompson shell is implemented via [[http:// | ||
- | An enhanced port of the Thompson shell is available on SDF as '' | + | An enhanced port of the Thompson shell is available on SDF as ''/ |
- | | + | **Ecl 1:** |
% setenv PATH / | % setenv PATH / | ||
/ | / | ||
- | | + | **Ecl 2:** |
% which osh if goto ^ ( tr ' | % which osh if goto ^ ( tr ' | ||
Line 31: | Line 31: | ||
-r-xr-xr-x | -r-xr-xr-x | ||
- | | + | **Ecl 3:** |
% if -r /netbsd echo /netbsd: Is readable ; \ | % if -r /netbsd echo /netbsd: Is readable ; \ | ||
Line 37: | Line 37: | ||
/netbsd: Is readable | /netbsd: Is readable | ||
- | ... \\ Notice that the '' | + | ... \\ Notice that the '' |
===== Bourne Shell ===== | ===== Bourne Shell ===== | ||
Line 43: | Line 43: | ||
This includes the original Bourne shell, its derivatives, | This includes the original Bourne shell, its derivatives, | ||
- | A Bourne-shell workalike is available on SDF as '' | + | A Bourne-shell workalike is available on SDF as ''/ |
- | | + | **Ecl 1:** |
$ PATH=/ | $ PATH=/ | ||
/ | / | ||
- | | + | **Ecl 2:** |
$ ls -l `which sh ksh bash` | $ ls -l `which sh ksh bash` | ||
Line 57: | Line 57: | ||
-rwxr-xr-x | -rwxr-xr-x | ||
- | | + | **Ecl 3:** |
$ if test -r /netbsd ; then echo /netbsd: Is readable ; fi ; \ | $ if test -r /netbsd ; then echo /netbsd: Is readable ; fi ; \ | ||
+ | > if test -w /netbsd ; then echo /netbsd: Is writable ; fi | ||
+ | /netbsd: Is readable | ||
+ | |||
+ | ===== Bourne-Again Shell ===== | ||
+ | |||
+ | The Bourne-Again shell (Bash) was written for the GNU project as a free software replacement for the Bourne shell. Bash can execute the vast majority of Bourne shell scripts without modification. However, its syntax has many extensions that are not present in the Bourne shell. | ||
+ | |||
+ | The Bourne-Again shell is available on SDF as ''/ | ||
+ | |||
+ | |||
+ | **Ecl 1:** | ||
+ | |||
+ | $ PATH=/ | ||
+ | / | ||
+ | |||
+ | **Ecl 2:** | ||
+ | |||
+ | $ ls -l `which sh ksh bash` | ||
+ | -r-xr-xr-x | ||
+ | -r-xr-xr-x | ||
+ | -rwxr-xr-x | ||
+ | |||
+ | **Ecl 3:** | ||
+ | |||
+ | $ if test -r /netbsd ; then echo /netbsd: Is readable ; fi ; \ | ||
+ | > if test -w /netbsd ; then echo /netbsd: Is writable ; fi | ||
+ | /netbsd: Is readable | ||
+ | |||
+ | |||
+ | ===== Z Shell ===== | ||
+ | |||
+ | The Z shell (Zsh) is an extended Bourne shell with many improvements. Paul Falstad wrote the first version of Zsh in 1990 at Princeton University. | ||
+ | |||
+ | The Z shell is available on SDF as ''/ | ||
+ | |||
+ | |||
+ | **Ecl 1:** | ||
+ | |||
+ | % PATH=/ | ||
+ | / | ||
+ | |||
+ | **Ecl 2:** | ||
+ | |||
+ | % ls -l `which csh tcsh zsh` | ||
+ | -r-xr-xr-x | ||
+ | -r-xr-xr-x | ||
+ | -r-xr-xr-x | ||
+ | |||
+ | **Ecl 3:** | ||
+ | |||
+ | % if test -r /netbsd ; then echo /netbsd: Is readable ; fi ; \ | ||
> if test -w /netbsd ; then echo /netbsd: Is writable ; fi | > if test -w /netbsd ; then echo /netbsd: Is writable ; fi | ||
/netbsd: Is readable | /netbsd: Is readable | ||
Line 67: | Line 118: | ||
This includes the original C shell, its derivatives, | This includes the original C shell, its derivatives, | ||
- | The C shell is available on SDF as '' | + | The C shell is available on SDF as ''/ |
- | | + | **Ecl 1:** |
% setenv PATH / | % setenv PATH / | ||
/ | / | ||
- | | + | **Ecl 2:** |
% ls -l `which csh tcsh zsh` | % ls -l `which csh tcsh zsh` | ||
Line 81: | Line 132: | ||
-r-xr-xr-x | -r-xr-xr-x | ||
- | | + | **Ecl 3:** |
% if (-r /netbsd) echo /netbsd: Is readable ; \ | % if (-r /netbsd) echo /netbsd: Is readable ; \ | ||
Line 89: | Line 140: | ||
===== Other Shells ===== | ===== Other Shells ===== | ||
- | Is this section needed? | + | FIXME |
This section will include information about the Z shell, rc (AT&T Plan 9 shell), and any other UNIX shell which does not neatly fall into one category..? | This section will include information about the Z shell, rc (AT&T Plan 9 shell), and any other UNIX shell which does not neatly fall into one category..? | ||
Line 99: | Line 150: | ||
---- | ---- | ||
- | UNIX® is a registered trademark of [[http:// | + | UNIX® is a registered trademark of [[http:// |
ultimate_differences_amongst_unix_shells.1615333128.txt.gz · Last modified: 2021/03/09 23:38 by hc9