The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Command line post-arguments with #!
@ 2011-12-15  1:46 Norman Wilson
  2011-12-15  3:07 ` Sven Mascheck
  0 siblings, 1 reply; 6+ messages in thread
From: Norman Wilson @ 2011-12-15  1:46 UTC (permalink / raw)


Sven Mascheck:

  With "original implementation (post 7th ed", I meant the undistributed
  BellLabs-internal further development of 7th, the first system ever
  to implement #!, leading to 8th ed, etc. (4BSD just incorporated this).
  Not System V or other relatives, though.

=======

Can you cite a reference?

I'm quite familiar with what went on inside the system that was
later called 8th Edition, having been on the inside at Bell Labs
starting in mid-1984.  But that was after the original research
group's general move to VAXes--they had no PDP-11s left by then,
except a few LSI-11s running special-purpose systems rather than
UNIX.  In fact the VAX kernel they had adopted, I think sometime
earlier that year, was derived from that of 4.1 BSD.  (It diverged
quite a bit from that start later, for which I am appreciably
to blame, but that has nothing to do with #!).

So if #! was implemented in an earlier kernel I don't know just
what was done.  I'd assumed it was no different; if I'm
mistaken I'd love to see just how it really was.

Alas, the person I know was on the spot and was likely to
remember just what happened in what order can no longer answer
questions ...

Norman Wilson
Toronto ON



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Command line post-arguments with #!
  2011-12-15  1:46 [TUHS] Command line post-arguments with #! Norman Wilson
@ 2011-12-15  3:07 ` Sven Mascheck
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Mascheck @ 2011-12-15  3:07 UTC (permalink / raw)


On Wed, Dec 14, 2011 at 08:46:38PM -0500, Norman Wilson wrote:
> Can you cite a reference?
> 
> I'm quite familiar with what went on inside the system that was
> later called 8th Edition, having been on the inside at Bell Labs
> starting in mid-1984.

All I know is the two mails from DMR from '80,

http://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/src/sys/newsys/sys1.c

">From dmr Thu Jan 10 04:25:49 1980 remote from research
The system has been changed so that if a file being executed
begins with the magic characters #! , [...]"

That's why I call it post-7th ed (between 7th and 8th ed) and why
I understand the above as original code (but I have no idea about
what went on with research Unix then).
Or should I interpret DMRs mail differently or with caution?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Command line post-arguments with #!
  2011-12-14 23:57 Norman Wilson
@ 2011-12-15  0:25 ` Sven Mascheck
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Mascheck @ 2011-12-15  0:25 UTC (permalink / raw)


On Wed, Dec 14, 2011 at 06:57:39PM -0500, Norman Wilson wrote:
> Sven Mascheck:
> 
>   Well the original implementation (post 7th ed and 4.0/4.1 BSD)
>   didn't allow arguments at all ;-)
> 
> ======
> 
> I believe you're mistaken.  All the implementations I've
> ever used allowed a single argument in the #! line,

With "original implementation (post 7th ed", I meant the undistributed
BellLabs-internal further development of 7th, the first system ever
to implement #!, leading to 8th ed, etc. (4BSD just incorporated this).
Not System V or other relatives, though.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Command line post-arguments with #!
@ 2011-12-14 23:57 Norman Wilson
  2011-12-15  0:25 ` Sven Mascheck
  0 siblings, 1 reply; 6+ messages in thread
From: Norman Wilson @ 2011-12-14 23:57 UTC (permalink / raw)


Sven Mascheck:

  Well the original implementation (post 7th ed and 4.0/4.1 BSD)
  didn't allow arguments at all ;-)

======

I believe you're mistaken.  All the implementations I've
ever used allowed a single argument in the #! line,
and inserted the name of the script between that (if
present) and the arguments given to exec.

e.g. if ./lipsum began with

	#!/usr/bin/awk -f

awk would be invoked with `/usr/bin/awk -f ./lipsum ...'.

Without allowing one argument for -f or the like,
#! wouldn't have been useful for much but the shell.

Norman Wilson
Toronto ON



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Command line post-arguments with #!
  2011-12-13  3:08   ` [TUHS] Command line post-arguments with #! Random832
@ 2011-12-14 23:36     ` Sven Mascheck
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Mascheck @ 2011-12-14 23:36 UTC (permalink / raw)


On Mon, Dec 12, 2011 at 10:08:20PM -0500, Random832 wrote:

> Speaking of DEMOS, I was browsing through that a while back (when it
> was first posted here;

I guess this: http://minnie.tuhs.org/pipermail/tuhs/2011-May/002387.html

> I forgot to post about it at the time) and saw a feature that
> doesn't seem to have existed anywhere else that I could find -
> placing interpreter arguments after the command line arguments
> of a script.

> I.e. something like "#!/bin/foo bar $* baz".

Now that looks like a quite special hack to me,
The mentioned d22.tar.gz -> d22/sys/sys.tar.Z -> sys/sys1.c has
# define SCRMAG  "#!"
# define SCRMAG2 "/*#!"
# define ARGPLACE "$*"
# define SHSIZE  70
# define ARGV    11
it accepts both #! and /*#! (equivalent), 70 chars, at most
11 arguments, and explains (russian guessed and then omitted here):

usually

    script x with "#!CMD A1 A2 A3"
    called as "x B1 B2"
    results in "CMD A1 A2 A3 /.../.../x B1 B2"

while in D22

    script x with "#!CMD A1 $* A2 A3"
    called as "x B1 B2"
    results in "CMD A1 /.../.../x B1 B2 A2 A3"

> Has any American unix had this?

I haven't seen such anywhere, but not the above until now, either.
But I believe that you can discard those which are listed here
http://www.in-ulm.de/~mascheck/various/shebang/#results
from your list of candidates.

> Some these days won't even allow multiple arguments at all.

Well the original implementation (post 7th ed and 4.0/4.1 BSD)
didn't allow arguments at all ;-)  But multiple arguments
definitely is the minority (AFAIK Plan9, some FreeBSD,
MacOSX, Minix, BSD/OS, and some early cygwin).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Command line post-arguments with #!
  2011-12-12  8:13 ` Jonathan Gevaryahu
@ 2011-12-13  3:08   ` Random832
  2011-12-14 23:36     ` Sven Mascheck
  0 siblings, 1 reply; 6+ messages in thread
From: Random832 @ 2011-12-13  3:08 UTC (permalink / raw)


On 12/12/2011 3:13 AM, Jonathan Gevaryahu wrote:
> comments-translated-to-russian version

Speaking of DEMOS, I was browsing through that a while back (when it was 
first posted here; I forgot to post about it at the time) and saw a 
feature that doesn't seem to have existed anywhere else that I could 
find - placing interpreter arguments after the command line arguments of 
a script.

I.e. something like "#!/bin/foo bar $* baz". Has any American unix had 
this? Some these days won't even allow multiple arguments at all.

I don't know Russian - it'd be interesting to see what else was 
unique/new in DEMOS.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-15  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15  1:46 [TUHS] Command line post-arguments with #! Norman Wilson
2011-12-15  3:07 ` Sven Mascheck
  -- strict thread matches above, loose matches on Subject: below --
2011-12-14 23:57 Norman Wilson
2011-12-15  0:25 ` Sven Mascheck
2011-12-08 23:08 [TUHS] speak.c, or sometimes the bits are under your nose Warren Toomey
2011-12-12  8:13 ` Jonathan Gevaryahu
2011-12-13  3:08   ` [TUHS] Command line post-arguments with #! Random832
2011-12-14 23:36     ` Sven Mascheck

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).