Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2021 08:34:31 +0900
From:      Tatsuki Makino <tatsuki_makino@hotmail.com>
To:        Dan Mahoney <freebsd@gushi.org>
Cc:        Miroslav Lachman <000.fbsd@quip.cz>, "freebsd-ports@FreeBSD.org" <freebsd-ports@freebsd.org>
Subject:   Re: Quick fun question: only set an rc.d variable sometimes?
Message-ID:  <PSAPR03MB563905368DA70ABC56A1F7C8FAA89@PSAPR03MB5639.apcprd03.prod.outlook.com>
In-Reply-To: <2BAA032C-E80A-431A-99E1-6126956DDC16@gushi.org>
References:  <5dabceea-7f3c-efbe-3778-67ca360547a@prime.gushi.org> <7d0ec8d5-1be3-dbd0-5f00-0cf51e3fa18f@quip.cz> <2BAA032C-E80A-431A-99E1-6126956DDC16@gushi.org>

next in thread | previous in thread | raw e-mail | index | archive | help
The rcscript is a /bin/sh script first, so all of Miroslav's replies are written in man sh.
However, the following differences

> : ${dummy_enable:=no}
> : ${dummy_msg="Nothing started."}

are only mentioned in manpage

>     In the parameter expansions shown previously, use of the colon in the
>     format results in a test for a parameter that is unset or null; omission
>     of the colon results in a test for a parameter that is only unset.

So we would have to read it in depth to realize why. :)

Any missing variables can be made up in the script.

: ${pidfile=${dummy_pidfile-/var/run/dummy.pid}}
if [ -z "${pidfile}" ] ; then
 pidfile='/var/run/dummy.pid'
fi

p.s.
I made a mistake in the address of the email, so I will send it again.
I'm sorry to those who received a duplicate. :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?PSAPR03MB563905368DA70ABC56A1F7C8FAA89>