mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Pozsar Balazs <pozsy@uhulinux.hu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG?] binfmt_script: interpreted interpreter doesn't work
Date: Sun, 15 Sep 2002 22:06:51 +0200	[thread overview]
Message-ID: <20020915220651.C642@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <Pine.GSO.4.30.0209151910220.22107-100000@balu>; from pozsy@uhulinux.hu on Sun, Sep 15, 2002 at 07:15:38PM +0200

Hi Pozsar,

On Sun, Sep 15, 2002 at 07:15:38PM +0200, Pozsar Balazs wrote:
> This may well not be bug, rather an intended feature, but please enlighten
> me why the following doesn't work:
> 
> I have two scripts:
> /home/pozsy/a:
> #!/bin/sh
> echo "Hello from a!"
> 
> /home/pozsy/b:
> #!/home/pozsy/a
> echo "hello from b!"
> 
> Both of them has +x permissions.
> But I cannot execute the /home/pozsy/b script:
> 
> Isn't this "indirection" allowed?

Right, this isn't allowed to avoid eating kernel resources
without getting anything done.

Solution is to always compile an interpreter or to write 
a wrapper in C, which is compiled and calls the perl interpreter
with your perl script. This wrapper would be ANSI-C with really
basic POSIX extensions and should thus be as portable as perl ;-)

So you hide the indirection from the kernel this way.

Of course you now define the wrapper as the interpreter for your
perl scripts.

Hope that helps.

Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth

  parent reply	other threads:[~2002-09-15 20:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-15 17:15 Pozsar Balazs
2002-09-15 19:05 ` Gilad Ben-Yossef
2002-09-15 19:14   ` Pozsar Balazs
2002-09-15 20:06 ` Ingo Oeser [this message]
2002-09-15 21:04   ` Pozsar Balazs
2002-09-15 21:18   ` Mark Veltzer
2002-09-15 21:19   ` jbradford
     [not found] <200209152055.05322.hpj@urpla.net>
2002-09-15 19:13 ` Pozsar Balazs
2002-09-15 19:34   ` Willy Tarreau
2002-09-15 21:00     ` Pozsar Balazs

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=20020915220651.C642@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pozsy@uhulinux.hu \
    /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®