From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754369AbcFANKH (ORCPT ); Wed, 1 Jun 2016 09:10:07 -0400 Received: from esgaroth.petrovitsch.at ([78.47.184.11]:5715 "EHLO esgaroth.tuxoid.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbcFANKE (ORCPT ); Wed, 1 Jun 2016 09:10:04 -0400 X-Greylist: delayed 3428 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Jun 2016 09:10:04 EDT Message-ID: <1464783168.2464.54.camel@petrovitsch.priv.at> Subject: Re: script relative shebang From: Bernd Petrovitsch To: Boris , Nicolai Stange Cc: linux-kernel@vger.kernel.org Date: Wed, 01 Jun 2016 14:12:48 +0200 In-Reply-To: <1A095838-A4DA-4215-8AB7-6ACC92802F0D@gmail.com> References: <87lh2pj0gi.fsf@gmail.com> <1A095838-A4DA-4215-8AB7-6ACC92802F0D@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-DCC-dcc1-Metrics: esgaroth.tuxoid.at 1182; Body=3 Fuz1=3 Fuz2=3 X-Spam-Report: * 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines * 2.9 AWL AWL: Adjusted score from AWL reputation of From: address Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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