From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 23 00:02:50 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF6E010F; Mon, 23 Sep 2013 00:02:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B14DB2107; Mon, 23 Sep 2013 00:02:50 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A182941E4; Mon, 23 Sep 2013 00:02:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A182941E4 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sun, 22 Sep 2013 20:02:48 -0400 From: Glen Barber To: Ian Lepore Subject: Re: The right way to invoke sh from a freebsd makefile? Message-ID: <20130923000248.GG2336@glenbarber.us> References: <1379891905.1197.115.camel@revolution.hippie.lan> <20130922232710.GD2336@glenbarber.us> <1379893071.1197.119.camel@revolution.hippie.lan> <20130922234555.GE2336@glenbarber.us> <1379894167.1197.126.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8S1fMsFYqgBC+BN/" Content-Disposition: inline In-Reply-To: <1379894167.1197.126.camel@revolution.hippie.lan> X-Operating-System: FreeBSD 10.0-ALPHA2 amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Hackers , freebsd-current X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 00:02:51 -0000 --8S1fMsFYqgBC+BN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 22, 2013 at 05:56:07PM -0600, Ian Lepore wrote: > > You can hard-code /bin/sh directly, but what I was getting at with the > > '#!/usr/bin/env sh' is that the 'sh' interpreter of the build > > environment could be used (instead of /bin/sh directly). Then you don't > > need to worry about the path to sh(1). > >=20 >=20 > My point is that the #! isn't used at all in this case, it doesn't > matter what's there. Try this... >=20 > echo "echo foo" >/tmp/foo > sh /tmp/foo >=20 > Not only does it not need the hashbang, the script doesn't even have to > be executable when you launch sh and name a script on the command line, > which is just what's needed to run a script from a directory mounted > with the noexec flag. >=20 Ah - maybe it's just late. I see what you mean now. Thanks. Glen --8S1fMsFYqgBC+BN/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQEcBAEBCAAGBQJSP4UoAAoJEFJPDDeguUaj91EH/1KMDVCKVlYuTsETjY/nf9v4 VJVPpStKKBrGfs1VtIu9Z+s202iBgRVZwu7qp9kbRUbaTP4h+4cQlgLlMWClCMMM x+M1wHJ4sYAmbec8yQCppXJOiu5pGJy37mZSsfRVaz6695PrOlmIfOXtGACY4ajZ st/EJRaz6gP8HFZe91kp3KW8cCZzxiLRPOdGw/m6DDjf9oAyywO8d9WWvpZs00IA 3M17XGR81s3BBGBnN4gghJEeRjtid8qjkI/32oUqUTkYy8An/lR1HIlpDq5T0ihX 2Qlv5Y/MhwQG0oP7RIwbMXEPyQitnj9GWQ62wS2rCTzcj6fObma1E3uOR0qJ7ts= =/mOq -----END PGP SIGNATURE----- --8S1fMsFYqgBC+BN/--