The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: grog@lemis.com (Greg 'groggy' Lehey)
Subject: [TUHS] Command-line options
Date: Sat, 26 Mar 2016 10:25:16 +1100	[thread overview]
Message-ID: <20160325232516.GG3766@eureka.lemis.com> (raw)
In-Reply-To: <20160325212925.GA5761@minnie.tuhs.org>

On Saturday, 26 March 2016 at  7:29:25 +1000, Warren Toomey wrote:
> On Fri, Mar 25, 2016 at 05:43:08PM +0300, Aharon Robbins wrote:
>> One of Unix's signature hallmarks is its terseness: short command names
>> like mv, ln, cp, cc, ed; short options (a dash and a single letter),
>> programs with just a few, if any, options at all, and short path names:
>> "usr" instead of "user", "src" instead of "source" and so on.
>> I have long theorized that the reason for the short names is that since
>> typing was so physically demanding, it was natural to make the command
>> names (and all the rest) be short and easier to type.  I don't know if
>> this was a conscious decision, but I suspect it more likely to have been
>> an unconscious / natural one.
>
> I'm going to throw in an aside at this point. PDP-7 Unix packed 2
> characters per 18-bit word.

Really?  Most machines of that era used 6 bit characters, so you could
fit 3 in an 18 bit word.  I had hypothesized that that was the reason
for word lengths in increments of 6 bits in those days.

> So, when comparing things, it's easy to compare one word against
> another. I believe this is why command-line options were 2
> characters (e.g. -l, -v, -c, -d) etc.

You've seen the code, of course.  Is that how it was done?

It's interesting to note that large UNIVAC systems in those days had a
similar option syntax.  The 1100 series would add them after a comma.
Here an example from a random command file:

  @ASG,AX    UNIVAC*DVP5.
  @ASG,T     DST1.,F14/88/TRK/88

ASG meant "assign", and the options were after the comma.  I'm a bit
vague about the exact meaning of the options, but they both associated
files with the current job.

The 494 did things slightly differently: there was no comma, and the
options came as a group, so instead of "@ASG,T" you might write
"#ASG T".  This is very reminiscent of some early Unix stuff, such as
tar.  The options were parsed by the shell equivalent (forget the
name) and packed into a single word bitmap.

In passing, it's interesting to note that the initial @ or # were used
to identify a command.  Other systems of the time did similar things.
My guess is that the command prompt in Unix started life as a "here's
your command leadin for free".

I don't think that Unix inherited anything from UNIVAC; it's more
likely that the similarities are indicative of common descent.

Greg
--
Sent from my desktop computer.
Finger grog at FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft MUA reports
problems, please read http://tinyurl.com/broken-mua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20160326/f4b43ad2/attachment.sig>


  reply	other threads:[~2016-03-25 23:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 14:43 [TUHS] Is the Teletype the unsung hero of Unix? Aharon Robbins
2016-03-25 19:47 ` Jaap Akkerhuis
2016-03-25 21:03 ` Diomidis Spinellis
2016-03-28 20:12   ` scj
2016-04-01 14:06     ` Dave Horsfall
2016-04-01 22:41       ` Greg 'groggy' Lehey
2016-03-25 21:29 ` [TUHS] Command-line options Warren Toomey
2016-03-25 23:25   ` Greg 'groggy' Lehey [this message]
2016-03-26  2:10     ` John Cowan
2016-03-26  3:09       ` Charles Anthony
2016-03-26 19:43         ` Clem Cole
2016-03-26 20:54           ` Ronald Natalie
2016-03-26 22:05             ` John Cowan
2016-03-27  1:25             ` Dave Horsfall
2016-03-27  1:50               ` Charles Anthony
2016-03-27  2:01               ` Greg 'groggy' Lehey
2016-03-27  6:18                 ` Random832
2016-03-27  6:57                   ` Greg 'groggy' Lehey
2016-03-27 19:38                   ` Dave Horsfall
2016-03-27  1:35             ` Greg 'groggy' Lehey
2016-03-26  3:54 ` [TUHS] Is the Teletype the unsung hero of Unix? Greg 'groggy' Lehey
2016-03-26  4:30   ` Steve Nickolas
2016-03-26  5:44     ` Greg 'groggy' Lehey
2016-03-26  8:33       ` Steve Nickolas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160325232516.GG3766@eureka.lemis.com \
    --to=grog@lemis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).