Date: Sun, 22 Sep 2013 20:02:48 -0400 From: Glen Barber <gjb@FreeBSD.org> To: Ian Lepore <ian@FreeBSD.org> Cc: FreeBSD Hackers <freebsd-hackers@FreeBSD.org>, freebsd-current <freebsd-current@FreeBSD.org> Subject: Re: The right way to invoke sh from a freebsd makefile? Message-ID: <20130923000248.GG2336@glenbarber.us> In-Reply-To: <1379894167.1197.126.camel@revolution.hippie.lan> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130923000248.GG2336>