User Tools

Site Tools


ultimate_differences_amongst_unix_shells

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ultimate_differences_amongst_unix_shells [2021/03/09 23:44] – [Thompson Shell] hc9ultimate_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://v6shell.org/man/if.1.html|if]](1) and [[http://v6shell.org/man/goto.1.html|goto]](1), which are external shell utilities. However, flow control in the Bourne and C shells is built into each shell. 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://v6shell.org/man/if.1.html|if]](1) and [[http://v6shell.org/man/goto.1.html|goto]](1), which are external shell utilities. However, flow control in the Bourne and C shells is built into each shell.
  
-An enhanced port of the Thompson shell is available on SDF as ''`/usr/pkg/bin/osh'''. You can read its manual by doing a ''`man osh''' at the command prompt. You can also read its manual [[http://v6shell.org/man/osh.1.html|online]] if you prefer to do so.+An enhanced port of the Thompson shell is available on SDF as ''/usr/pkg/bin/osh''. You can read its manual by doing a ''man osh'' at the command prompt. You can also read its manual [[http://v6shell.org/man/osh.1.html|online]] if you prefer to do so.
  
 **Ecl 1:** **Ecl 1:**
Line 37: Line 37:
   /netbsd: Is readable   /netbsd: Is readable
  
-... \\  Notice that the ''`setenv''' command above is not available in the original Thompson shell. This is just one of the **osh** enhancements. Do we want to say anything about the PWB shell?+... \\  Notice that the ''setenv'' command above is not available in the original Thompson shell. This is just one of the **osh** enhancements. Do we want to say anything about the PWB shell?
  
 ===== Bourne Shell ===== ===== Bourne Shell =====
Line 43: Line 43:
 This includes the original Bourne shell, its derivatives, and workalikes. A true Bourne shell or a Bourne-like shell typically serves as the standard command interpreter on most UNIX systems. This includes the original Bourne shell, its derivatives, and workalikes. A true Bourne shell or a Bourne-like shell typically serves as the standard command interpreter on most UNIX systems.
  
-A Bourne-shell workalike is available on SDF as ''`/bin/sh'''. You can read its manual by doing a ''`man sh''' at the command prompt. You can also read its manual [[http://netbsd.gw.com/cgi-bin/man-cgi?sh+1.alpha+NetBSD-2.1|online]] if you prefer to do so.+A Bourne-shell workalike is available on SDF as ''/bin/sh''. You can read its manual by doing a ''man sh'' at the command prompt. You can also read its manual [[http://netbsd.gw.com/cgi-bin/man-cgi?sh+1.alpha+NetBSD-2.1|online]] if you prefer to do so.
  
-  Ecl 1:+**Ecl 1:**
  
   $ PATH=/usr/pkg/bin:/usr/bin:/bin ; export PATH ; printenv PATH   $ PATH=/usr/pkg/bin:/usr/bin:/bin ; export PATH ; printenv PATH
   /usr/pkg/bin:/usr/bin:/bin   /usr/pkg/bin:/usr/bin:/bin
  
-  Ecl 2:+**Ecl 2:**
  
   $ ls -l `which sh ksh bash`   $ ls -l `which sh ksh bash`
Line 57: Line 57:
   -rwxr-xr-x  1 root  wheel  963696 Jun  4 08:57 /usr/pkg/bin/bash   -rwxr-xr-x  1 root  wheel  963696 Jun  4 08:57 /usr/pkg/bin/bash
  
-  Ecl 3:+**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 ''/usr/pkg/bin/bash''. You can read its manual by doing a ''man bash'' at the command prompt.
 +
 +
 +**Ecl 1:**
 +
 +  $ PATH=/usr/pkg/bin:/usr/bin:/bin ; export PATH ; printenv PATH
 +  /usr/pkg/bin:/usr/bin:/bin
 +
 +**Ecl 2:**
 +
 +  $ ls -l `which sh ksh bash`
 +  -r-xr-xr-x  1 root  wheel  298431 Oct 24  2005 /bin/ksh
 +  -r-xr-xr-x  1 root  wheel  199717 Oct 24  2005 /bin/sh
 +  -rwxr-xr-x  1 root  wheel  963696 Jun  4 08:57 /usr/pkg/bin/bash
 +
 +**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 ''/usr/pkg/bin/zsh''. You can read its manual by doing a ''man zsh'' at the command prompt.
 +
 +
 +**Ecl 1:**
 +
 +  % PATH=/usr/pkg/bin:/usr/bin:/bin ; export PATH ; printenv PATH
 +  /usr/pkg/bin:/usr/bin:/bin
 +
 +**Ecl 2:**
 +
 +  % ls -l `which csh tcsh zsh`
 +  -r-xr-xr-x  1 root  wheel  214333 Oct 24  2005 /bin/csh
 +  -r-xr-xr-x  1 root  wheel  459408 Jun 29  2005 /usr/pkg/bin/tcsh
 +  -r-xr-xr-x  2 root  wheel    6352 May 11  2007 /usr/pkg/bin/zsh
 +
 +**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, and workalikes. This includes the original C shell, its derivatives, and workalikes.
  
-The C shell is available on SDF as ''`/bin/csh'''. You can read its manual by doing a ''`man csh''' at the command prompt. You can also read its manual [[http://netbsd.gw.com/cgi-bin/man-cgi?csh+1.alpha+NetBSD-2.1|online]] if you prefer to do so.+The C shell is available on SDF as ''/bin/csh''. You can read its manual by doing a ''man csh'' at the command prompt. You can also read its manual [[http://netbsd.gw.com/cgi-bin/man-cgi?csh+1.alpha+NetBSD-2.1|online]] if you prefer to do so.
  
-  Ecl 1:+**Ecl 1:**
  
   % setenv PATH /usr/pkg/bin:/usr/bin:/bin ; printenv PATH   % setenv PATH /usr/pkg/bin:/usr/bin:/bin ; printenv PATH
   /usr/pkg/bin:/usr/bin:/bin   /usr/pkg/bin:/usr/bin:/bin
  
-  Ecl 2:+**Ecl 2:**
  
   % ls -l `which csh tcsh zsh`   % ls -l `which csh tcsh zsh`
Line 81: Line 132:
   -r-xr-xr-x  2 root  wheel    6352 May 11  2007 /usr/pkg/bin/zsh   -r-xr-xr-x  2 root  wheel    6352 May 11  2007 /usr/pkg/bin/zsh
  
-  Ecl 3:+**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://www.opengroup.org/tm-guidelines.htm|The Open Group]]. \\ \\  $Id: shells.html,v 1.1 2008/12/19 16:35:57 jwodder Exp $ [[http://sdf.org/?tutorials/shells|Ultimate Differences Amongst UNIX® Shells]] - legacy link+UNIX® is a registered trademark of [[http://www.opengroup.org/tm-guidelines.htm|The Open Group]]. \\ \\  $Id: shells.html,v 1.1 2008/12/19 16:35:57 jwodder Exp $ [[http://sdf.org/?tutorials/shells|Ultimate Differences Amongst UNIX® Shells]] - traditional link (using [[wp>Revision_Control_System|RCS]])
  
ultimate_differences_amongst_unix_shells.1615333443.txt.gz · Last modified: 2021/03/09 23:44 by hc9