The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: mascheck@in-ulm.de (Sven Mascheck)
Subject: [TUHS] Command line post-arguments with #!
Date: Thu, 15 Dec 2011 00:36:31 +0100	[thread overview]
Message-ID: <20111214233631.GA9448@lisa.in-ulm.de> (raw)
In-Reply-To: <4EE6C1A4.7030107@fastmail.us>

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



  reply	other threads:[~2011-12-14 23:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 23:08 [TUHS] speak.c, or sometimes the bits are under your nose Warren Toomey
2011-12-09 22:43 ` Al Kossow
2011-12-09 23:17   ` Al Kossow
2011-12-11  2:11   ` Jonathan Gevaryahu
2011-12-11  0:34 ` Jonathan Gevaryahu
2011-12-11  2:51   ` Doug McIlroy
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 message]
2011-12-13 19:29   ` [TUHS] speak.c, or sometimes the bits are under your nose Jonathan Gevaryahu
2011-12-14 23:57 [TUHS] Command line post-arguments with #! Norman Wilson
2011-12-15  0:25 ` Sven Mascheck
2011-12-15  1:46 Norman Wilson
2011-12-15  3:07 ` Sven Mascheck

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=20111214233631.GA9448@lisa.in-ulm.de \
    --to=mascheck@in-ulm.de \
    /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).