[TUHS] Shell control through external commands

Mary Ann Horton mah at mhorton.net
Fri Jul 15 00:12:57 AEST 2016

I thought the V6 Mashey shell didn't have anything built in, but there 
were external commands such as goto that would seek the open file 
descriptor to a location matching a label, which would be a comment 
(beginning with a colon, which was a no-op command.)  There would also 
have been an "if" command or option to goto or something.

On 07/14/2016 06:23 AM, Clem Cole wrote:
> Could you be confusing the fact the true and false were implemented by 
> external commands in some early shell's
> On Thu, Jul 14, 2016 at 9:18 AM, Diomidis Spinellis <dds at aueb.gr 
> <mailto:dds at aueb.gr>> wrote:
>     I remember hearing that originally the Unix shell had control
>     structures (e.g. if, while, case) implemented through external
>     commands.  However, I can't see this reflected in the source
>     code.  The 7th Edition Bourne shell has these commands built-in
>     (usr/src/cmd/sh/cmd.c), while the 6th Edition (usr/source/s2/sh.c)
>     seems to lack them completely.
>     The only external command I found was glob, which performed
>     wildcard expansion.
>     Am I missing something?  Was this implemented in a version that
>     was never released?  If so, does anyone know how this
>     implementation worked?  (Nested commands might require holding
>     some sort of globally accessible stack.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20160714/e6d40b7b/attachment.html>

More information about the TUHS mailing list