From owner-freebsd-questions@freebsd.org Tue Jan 31 17:27:31 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C0ACCA1B6 for ; Tue, 31 Jan 2017 17:27:31 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C178E7 for ; Tue, 31 Jan 2017 17:27:30 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from zero-gravitas.local (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 55575A685 for ; Tue, 31 Jan 2017 17:27:25 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/55575A685; dkim=none; dkim-atps=neutral Subject: Re: Variable assignment in sh To: freebsd-questions@freebsd.org References: <20170131161824.a9f1ef46.freebsd@edvax.de> From: Matthew Seaman Message-ID: <55ebe089-8e89-cad3-dbb7-55b9918e8cca@FreeBSD.org> Date: Tue, 31 Jan 2017 17:27:19 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QITHRtdrWmjP7LanHxAliNefBLfgOmNNK" X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,RCVD_IN_RP_RNBL, RDNS_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 17:27:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QITHRtdrWmjP7LanHxAliNefBLfgOmNNK Content-Type: multipart/mixed; boundary="6J9qgRCP2kvX2EqF3mM1XHi9kjLoXd3ue"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <55ebe089-8e89-cad3-dbb7-55b9918e8cca@FreeBSD.org> Subject: Re: Variable assignment in sh References: <20170131161824.a9f1ef46.freebsd@edvax.de> In-Reply-To: --6J9qgRCP2kvX2EqF3mM1XHi9kjLoXd3ue Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2017/01/31 17:11, James B. Byrne via freebsd-questions wrote: >> a shell script (FreeBSD's default scripting shell) > What does this mean exactly? Is not CSH a shell? I thought that the > shell used in cron was the shell of the user associated with the > crontab file? What is cron's default shell otherwise? He's making a distinction between a shell for interactive use -- which defaults to tcsh or csh in the FreeBSD base system -- and a shell used for programming shell scripts -- which defaults to /bin/sh. Of course, either shell can be used in either role, but writing scripts in csh is a bit painful, and /bin/sh doesn't have all the nice bells'n'whistles for interactive use. The default shell used for cron jobs is /bin/sh, irrespective of the login shell of the user who owns the crontab. You can override this from within the crontab by adding eg. SHELL=3D/bin/tcsh and, of course, you can just specify the appropriate shell on the command line inside crontab or by setting a #! line at the top of any executable scripts. Cheers, Matthew --6J9qgRCP2kvX2EqF3mM1XHi9kjLoXd3ue-- --QITHRtdrWmjP7LanHxAliNefBLfgOmNNK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJYkMj8XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTn40EP/3oFh8U5QMCWa3mXPaH/wAiF Scgvt1zVkqu4skY+alWPdndcvb2+aM6trDGumC6Vv8l1cAfKjhNtkgpmU2q7bHJw p81RJngDa1R6phS8NuFxQWfZEKDIDpB+2OdfqHo46iNf+8tnItWAx0kViQ4oS/j2 lIgOhgbr4jmwTvOmv9OB0+l7/hdeGfPccCgVtAstS/WQM9taleocLmAUDNgsj1j+ nYBzBaH0OBI6HiF0LQ/RtZ7MlC14Tt4rZ1j+l4pCypbbPZxG7V8XoWe1NYIHzs25 brh0ajVQJ2QdNZogRZ/AQKSHVQXY/wFwQpn+ptpzl+WqmuC7WyejCo6o5nZIFj7k 1MFf6M2JoqjTNcDZfCDaNz8opxbAgy9VrHJTaWHzSvvR4Zekzx5trdIfSmgPuUBh 8QXz/IPoHmYqoCdA7Iy+LSH9cjaKW6Ah0pndsA1zqs//b7D4+SCmAK8EViGjhDri bm62ovR2RX9DKnQ0vwMDSJkw+cTEartW+mbG+i4cfaLhBgcPG7Rxb0MHAUadqI7G Syif4pBC1dEY0bcTG/uhnfxmfsxx4ifNvuhk+AV3+wnCKMgv3xEMg7Bnms40KEim izPIl5wVaw41kW8oyLP5Mohlj0VqhN6EFgVSOLfU1sDKBPIEV/Gy71Ajpt/kSQVI sjeNIuQtki/Iu94jmxAN =N+B3 -----END PGP SIGNATURE----- --QITHRtdrWmjP7LanHxAliNefBLfgOmNNK--