From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 22 23:25:51 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 0DAA0EE7 for ; Sun, 22 Sep 2013 23:25:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0F542E82 for ; Sun, 22 Sep 2013 23:25:50 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MNPobU099757 for ; Sun, 22 Sep 2013 23:25:50 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8MNPo26099753 for freebsd-hackers@FreeBSD.org; Sun, 22 Sep 2013 23:25:50 GMT (envelope-from bdrewery) Received: (qmail 71530 invoked from network); 22 Sep 2013 18:25:46 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 22 Sep 2013 18:25:46 -0500 Message-ID: <523F7C78.8080603@FreeBSD.org> Date: Sun, 22 Sep 2013 18:25:44 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Ian Lepore Subject: Re: The right way to invoke sh from a freebsd makefile? References: <1379891905.1197.115.camel@revolution.hippie.lan> In-Reply-To: <1379891905.1197.115.camel@revolution.hippie.lan> X-Enigmail-Version: 1.5.2 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1viU4XMpO19OV2vj6IXJPqJhrVikWAOM" 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: Sun, 22 Sep 2013 23:25:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --X1viU4XMpO19OV2vj6IXJPqJhrVikWAOM Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 9/22/2013 6:18 PM, Ian Lepore wrote: > What's the right way to launch the bourne shell from a makefile? I had= > assumed the ${SHELL} variable would be set to "the right" copy > of /bin/sh (like maybe the one in tmp or legacy at various stages). It= > appears that that's not the case, and ${SHELL} is whatever comes from > the environment, which can lead to using csh or bash or whatever. >=20 > I see some of our makefiles use just a bare "sh" which seems reasonable= > to me, but I don't want to glitch this in src/include/Makefile again. > The goal is to run a script in src/include/Makefile by launching sh wit= h > the script name (as opposed to launching the script and letting the #! > do its thing, which doesn't work if the source dir is mounted noexec). >=20 > -- Ian >=20 Grepping the Makefiles in the tree, 'sh' is the very common. I see around 157 users of this pattern. 13 use /bin/sh directly. Also consider that it is highly likely, if not required, that a /bin/sh will exist. Calling 'sh' specifically is definitely more proper than ${SHELL} since it is an sh script. --=20 Regards, Bryan Drewery --X1viU4XMpO19OV2vj6IXJPqJhrVikWAOM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSP3x4AAoJEG54KsA8mwz5kSAP/2wm6+efiXjPZAKG2AYntqPX seA40sfTGd0p81eW32HroEv+r3bg0FXL4CnRoIduQQ68tPLvlVA8/V/4JnD/LE3L EiIIru5sRvW1QodHTRVB572jknocFULFg7VquLeEc6mXCmjuvdslHhgnJk84/MZa ZMrhyQzw+HmGzkVGACqFC98FIQsRASwEWxBihz6C2n0naVUo5DhPfjio/uKOtq5+ QBUMvICAAA0K2S2foPP1fV8tyefQxWl43uGxFQqj9GDmU7xAYCjkC0TmJ7cHgCcI h39jGNABCQ8pR8wwEdI8JvbF9XaqukAPuuU3yov0MfWi0waKPWZaX6rWdtLeMpkP JXfBovXR3gyWE5LjYTqja4NFmhbA4bzq/GJhXa5IB4K0XcVOQhj5Eb/MdfniXADz bsspdkR+NDNtNmHB9tAdjE/Bvh0KoRc4+BhF2aQCua5yHrVQPaAJP3g0AvquD1Ux j8u9pXbrTx6dLHdhmASmD/C/lB6L0HMjpGC1peUweZGl7a5uR/Ln+QegokdJuPbk BnGSZb0eKxp28auIMbAPlGPziEAouXprLbJ4mihtP5WT9zwUeZmrmUzNXluwEofA 59q3wneeYnwFOgRnTYO0qKqAqKW/GLaMjl/AIuwmMn7LemCVKmVRQE6A/mw4x/OK ICSdGlW0nZC+1oLmllDG =bH97 -----END PGP SIGNATURE----- --X1viU4XMpO19OV2vj6IXJPqJhrVikWAOM--