linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
To: Boris <ribalkin@gmail.com>, Nicolai Stange <nicstange@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: script relative shebang
Date: Wed, 01 Jun 2016 14:12:48 +0200	[thread overview]
Message-ID: <1464783168.2464.54.camel@petrovitsch.priv.at> (raw)
In-Reply-To: <1A095838-A4DA-4215-8AB7-6ACC92802F0D@gmail.com>

Hi all!

On Wed, 2016-06-01 at 09:00 +0100, Boris wrote:
[...]
> Yes, I think this is too ugly:
> 
> #!/usr/bin/gawk {exit system("/bin/sh -c 'exec \"$(dirname
> \"$0\")\"/subdir/catself \"$0\"' " FILENAME);}

The simplest solution for an application today is to provide a wrapper
script/program (to be placed in /usr/bin or /usr/local/bin) which knows
where to search for the applications executables - if adding some
directories to $PATH is not enough.

> Imagine you have that feature in your kernel would you rather use:
> 
> #!{dirname}/subdir/catself

And what if "{dirname}" (or any other character sequence) happens to be
a valid pathname?

> You second advice involves changing root fs which is not desirable in
> copy-deployment apps (bring all the dependencies)
> 
> This more about making kernel "user" friendly.

User-friendlyness is not the job of the kernel ...

[ Fullquote deleted as it's a bad habit ]

MfG,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@petrovitsch.priv.at
                     LUGA : http://www.luga.at

  reply	other threads:[~2016-06-01 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 21:47 script relative shebang Boris Rybalkin
2016-05-31 23:02 ` Nicolai Stange
2016-06-01  8:00   ` Boris
2016-06-01 12:12     ` Bernd Petrovitsch [this message]
2016-06-01 15:38     ` Austin S. Hemmelgarn
2016-06-02  0:04       ` Boris Rybalkin
2016-06-02  4:19         ` Ken Moffat
2016-06-02 22:41           ` Boris

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=1464783168.2464.54.camel@petrovitsch.priv.at \
    --to=bernd@petrovitsch.priv.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicstange@gmail.com \
    --cc=ribalkin@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;
as well as URLs for NNTP newsgroup(s).