public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Andries Brouwer <aebr@win.tue.nl>
Cc: jamie@shareable.org, hjlipp@web.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Linux 2.6: shebang handling in fs/binfmt_script.c
Date: Mon, 23 Feb 2004 13:46:10 -0800	[thread overview]
Message-ID: <20040223134610.3b6d01a9.pj@sgi.com> (raw)
In-Reply-To: <20040223173446.GA2830@pclin040.win.tue.nl>

Andries Brouwer wrote:
>  If there is such nonblank text then for SysVR4,
>  SunOS, Solaris, IRIX, HPUX, AIX, Unixware, Linux, OpenBSD, Tru64
>  this group consists of precisely one argument.
>  FreeBSD, BSD/OS, BSDI split the text

Interesting - I notice that 9 Operating Systems, in addition to Linux,
don't split the optional shebang argument, and 3 do.

All else equal, I am not enthusiastic about a somewhat arbitrary change
that could be done either way, that is actually done more often in other
operating systems the current way, and that potentially affects both
script files and their interpreters (shells, awk, perl, python, guile,
tcl, bc, ...).

I will acknowledge however that if there was a shell or interpreter that
allowed at most one '-' prefixed option before the path to the script
file to be interpreted, that that shell or interpreter would be poorly
coded.

And, to be truthful, the usual way that I code awk scripts is not as
a shbang script with an interpreter of awk,

  #!/bin/awk
  BEGIN ...

but rather as a quoted awk script within a shell script:

  #!/bin/sh
  awk '
    BEGIN ...
  '

It is then trivial to supply one or several options to 'awk', and
(as the tclsh man page notes) to cope with possible diverse locations
along $PATH of the interpreter.

This is especially useful in the case of awk, since it is not a
convenient language for many things that are easily done in a shell.
That is, I don't write awk scripts, so much as I write shell scripts
that might make use of awk.

This is a portable habit, that avoids all the afore mentioned
limitations and inconsistencies in shbang handling.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

  parent reply	other threads:[~2004-02-23 21:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16 13:34 [PATCH] Linux 2.6: shebang handling in fs/binfmt_script.c Hansjoerg Lipp
2004-02-22 10:09 ` Paul Jackson
2004-02-22 15:54   ` Hansjoerg Lipp
2004-02-22 20:53     ` Paul Jackson
2004-02-22 22:57       ` Jamie Lokier
2004-02-23  5:44         ` Paul Jackson
2004-02-23 14:22           ` Jamie Lokier
2004-02-23 17:34             ` Andries Brouwer
2004-02-23 20:13               ` Paul Jackson
2004-02-23 21:46               ` Paul Jackson [this message]
2004-02-24  1:13                 ` Hansjoerg Lipp
2004-02-24  1:29                   ` Paul Jackson
2004-02-25 23:13                     ` Hansjoerg Lipp
2004-02-23 20:12             ` Paul Jackson
2004-02-23 20:16               ` Jamie Lokier
2004-02-23 22:08                 ` Paul Jackson
2004-02-23 20:25           ` Hansjoerg Lipp
2004-02-23 22:00             ` Paul Jackson
2004-02-23 23:59               ` Jamie Lokier
2004-02-24  0:13               ` Hansjoerg Lipp
2004-02-24  1:32                 ` Paul Jackson
2004-02-25 23:14                   ` Hansjoerg Lipp
2004-02-25 23:24                     ` Paul Jackson
2004-02-23 20:13       ` Hansjoerg Lipp
2004-02-23 22:24         ` Paul Jackson
2004-02-24  0:21           ` Hansjoerg Lipp
2004-02-23  5:49     ` Paul Jackson
2004-02-23  5:50     ` Paul Jackson
2004-02-23  5:42 ` Paul Jackson
2004-02-23 20:24   ` Hansjoerg Lipp
2004-02-23 21:55     ` Paul Jackson

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=20040223134610.3b6d01a9.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=aebr@win.tue.nl \
    --cc=hjlipp@web.de \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    /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