Subject: Re: HEADS UP: RCD_SCRIPTS_EXAMPLEDIR changed to share/examples/rc.d
To: Todd Vierling <tv@duh.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-pkg
Date: 01/02/2005 01:47:30
--0ntfKIWw70PvrIHh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Dec 28, 2004 at 08:11:51PM -0500, Todd Vierling wrote:
| Use the construct:
|=20
| : ${foo:=3DNO}
|=20
| This won't override an existing setting. I use this in all kinds of sh=
ell
| scripts, and I believe autoconf uses it too.
I have used this techinique in rc.d scripts as well.
It is important to use it correctly, and only assign the default
after rc.conf(5) has been (re)loaded. I.e:
name=3Dfoo
rcvar=3D"$name"
# [...]
load_rc_config $name
: ${foo:=3DNO}
run_rc_config
--0ntfKIWw70PvrIHh
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
iD8DBQFB1rgCpBhtmn8zJHIRAgI1AJ9kA8Dn1s9JUzXslwEXSuHkkf58JACfY6N8
LYDajIhpESBA4+tGpz/ooMo=
=DPjR
-----END PGP SIGNATURE-----
--0ntfKIWw70PvrIHh--