Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unix before sh

28 views
Skip to first unread message

Jeff Robertson

unread,
Feb 10, 1994, 1:27:25 PM2/10/94
to
I read somewhere that the sh program was written during the 70's.
How can this be, if Unix itself came out in the late 60's ? Was there some
other way to use Unix BEFORE the shell existed ? Or was this just a mistake ?

Remember, I'm not as ignorant as this question sounds.

Jeff Robertson <jrob...@ua1ix.ua.edu>, <jrob...@ua1vm.ua.edu>
GCS/MU/O -d+ -p+ c++ u@ e+ m* s+/-- n--- h-- f@ g@ w+ t++ y-(*)
-----
I wonder if I should put myself in ESCROW!!

John Van Vlaanderen

unread,
Feb 18, 1994, 3:44:00 AM2/18/94
to

>Was there some other way to use Unix BEFORE the shell existed ?
>Or was this just a mistake ?

I read a really great posting on the history of UNIX but I lost it and
dont even remember the use-group. But gist was that UNIX was developed
just after MULTICS was pulled out of ATT and our friends out there in
Bell-land wrote the be-all-to-end-all with the user in mind, hence the
shell interperter.

One of the influences was pressure from congress solve a service crisis
in the late sixties at MaBell so UNIX was designed around the technicians
so as to allow them to trouble shoot and communicate centrally. Prior to
this the techs basically had to haul out all the parts and swap one by one
to isolate the problem. I believe it was launched in 1969, part of the
70's IMHO.

Two other criteria were the concept of i/o were the processes dont necessarily
know were it is coming from or going and the use of delimited fields rather
than positional fields.

I really wish I had that draft, though. It explains why I liked UNIX as soon
as I found out about it. I also learned that my c.s. dept was one of the small
percentage that didnt have it hence my late arrival.

_jo...@ejv.com_

Mark Brader

unread,
Feb 23, 1994, 6:58:36 PM2/23/94
to
> Was there some other way to use Unix BEFORE the shell existed ?

Simple: the shell now known as /bin/sh is not the first of that name.

The present one first appeared with V7 (aka "7th edition") UNIX in 1979.
The V7 documentation (which fit in two binders) included a summary, slightly
over 1 printed page long, about "converting from the 6th edition". From it:

# F. L. Bauer once said Algol 68 is the Everest that must be climbed
# by every computer scientist because it is there. So it is with the
# shell for UNIX users. Everything beyond simple command invocation
# from a terminal is different. Even chdir is now spelled cd. You
# will want to study sh(1) long and hard.

Incidentally, the *original* spelling of cd was not chdir either, but ch.
This had changed pretty early on.

To cite a few other differences that I remember, in V6's sh:

There was no `...` construct, and no direct replacement for it.
The program now called xargs was available under the name args.
There were also no "here documents" (the << construct).

The structured programming constructs, if with a multiline body
and while-loops, were not available. Instead there were labels
and gotos. The no-op command : existed, as it still does, but had
the additional meaning that its argument was a label for gotoing.

(Incidentally, in V7 the : command was still the only way to get a
shell script, which was annoying because its argument was parsed.
Everyone I knew with V7 modified their sh to take # comments.)

Only stdin and stdout could be redirected. Contrary to what the
above quote might imply, the syntax for this and for pipes was the
same as in the later sh. This is why the examples in the original
CACM UNIX paper of 1974 are generally still valid today.

Shell variables were restricted to names of one lower case letter,
and there was no concept of exporting them into the environment or
marking them as read-only. However, half of the alphabet was
read-only to start with, reserved for the implementation. I remember
that $HOME was a read-only $s (start directory), for instance.

Assigning to a shell variable was done by the = command, which read
stdin and took the variable name as an argument. For example,

date | = d meaning d=`date`

The ${... constructs to conditionally read from a variable were absent.

That should give you the flavor of things. It was a lot simpler shell
than even the original V7 sh (which in turn was simpler than versions
of sh released today, which in turn are simpler than most other shells).

One place to read about *very* early Unix (as they spelled it then) is in
the October 1984 special UNIX issue of the AT&T Bell Laboratories Technical
Journal, which should be available in university libraries and suchlike;
the first article or two in the issue describe the beginnings of the system.
This is the source of the tidbit about ch, for instance.

There was an earlier special UNIX issue of the same magazine, which was
then called the Bell Systems Technical Journal, in 1978 or thereabouts;
I haven't read that one.
--
Mark Brader "Ken doesn't spell very well.
SoftQuad Inc., Toronto Fortunately, he has other virtues."
utzoo!sq!msb, m...@sq.com -- Dennis Ritchie

This article is in the public domain.

0 new messages