Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2017 17:27:19 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Variable assignment in sh
Message-ID:  <55ebe089-8e89-cad3-dbb7-55b9918e8cca@FreeBSD.org>
In-Reply-To: <b553c644fccc211f9658b31cfe65e8a0.squirrel@webmail.harte-lyne.ca>
References:  <b831bd9e40321e59910ea8913c7a6302.squirrel@webmail.harte-lyne.ca> <20170131161824.a9f1ef46.freebsd@edvax.de> <b553c644fccc211f9658b31cfe65e8a0.squirrel@webmail.harte-lyne.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--QITHRtdrWmjP7LanHxAliNefBLfgOmNNK
Content-Type: multipart/mixed; boundary="6J9qgRCP2kvX2EqF3mM1XHi9kjLoXd3ue";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-questions@freebsd.org
Message-ID: <55ebe089-8e89-cad3-dbb7-55b9918e8cca@FreeBSD.org>
Subject: Re: Variable assignment in sh
References: <b831bd9e40321e59910ea8913c7a6302.squirrel@webmail.harte-lyne.ca>
 <20170131161824.a9f1ef46.freebsd@edvax.de>
 <b553c644fccc211f9658b31cfe65e8a0.squirrel@webmail.harte-lyne.ca>
In-Reply-To: <b553c644fccc211f9658b31cfe65e8a0.squirrel@webmail.harte-lyne.ca>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55ebe089-8e89-cad3-dbb7-55b9918e8cca>