From: "Aaron Cohen" <aaron@assonance.org>
To: Geralt <usr.gentoo@googlemail.com>
Cc: Valdis.Kletnieks@vt.edu,
"Américo Wang" <xiyou.wangcong@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: Shebang - why are parameters not splitted on whitespace?
Date: Sat, 6 Dec 2008 13:14:50 -0800 [thread overview]
Message-ID: <727e50150812061314w5c80e32ageca9c7eddc2e7aa9@mail.gmail.com> (raw)
In-Reply-To: <fbdd0e50812060402q6aaaed6q6bb345c50ed68b07@mail.gmail.com>
You should read this thread:
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/arch/2005-02/0039.html
The shebang processing needs to somehow magically split up the first
line into the file into "some number of arguments for the interpreter"
"some number of arguments for the script being run", and "the script
being run."
The first two are the big difficulty, how should the kernel know which
arguments are meant for the interpreter and which are meant for the
script?
In the article I referenced, current Linux behavior seems to conform
to at least the majority of other OSes do, and I believe freeBSD
actually moved from trying to split the arguments up into something
similar (though I couldn't swear to it).
--Aaron
On Sat, Dec 6, 2008 at 4:02 AM, Geralt <usr.gentoo@googlemail.com> wrote:
> On Sat, Dec 6, 2008 at 6:41 AM, <Valdis.Kletnieks@vt.edu> wrote:
>> On Sat, 06 Dec 2008 01:04:52 GMT, Américo Wang said:
>>> On Wed, Dec 3, 2008 at 5:29 PM, Geralt <usr.gentoo@googlemail.com> wrote:
>>> > Hello,
>>> >
>>> > I should have anticipated this objection :-). I'm aware that this is
>>> > not consistent among Unix operating systems (you can find more about
>>> > it here [1]), but I was specifically refering to linux in this case
>>> > and why it handles the shebang arguments as one big string and not as
>>> > single arguments for the application.
>>>
>>> I can't think out any strong reasons, maybe only becasue Linux developers
>>> prefer that approach.
>>
>> And of course, "whitespace" is a somewhat fungible concept. 'man bash'
>> and read about $IFS.
>>
> So you're saying that you can't do that because you don't know where
> to split the parameters, right? But would it be that bad to state a
> rule what "whitespace" is in the shebang line?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
prev parent reply other threads:[~2008-12-06 21:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-03 15:14 Geralt
2008-12-03 15:56 ` Américo Wang
[not found] ` <fbdd0e50812030929q65d2e805y49094dd67209be7e@mail.gmail.com>
2008-12-03 17:29 ` Geralt
2008-12-06 1:04 ` Américo Wang
2008-12-06 5:41 ` Valdis.Kletnieks
2008-12-06 12:02 ` Geralt
2008-12-06 21:14 ` Aaron Cohen [this message]
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=727e50150812061314w5c80e32ageca9c7eddc2e7aa9@mail.gmail.com \
--to=aaron@assonance.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=usr.gentoo@googlemail.com \
--cc=xiyou.wangcong@gmail.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
all inboxes | Powered by JetHome®