from /lib/lsb/init-functions (maybe this file is debian specific, but doesn’t really matter for the question):
pidofproc () {
local pidfile line i pids= status specified pid
pidfile=
specified=
Whats the difference between saying
local a
and
local a=
?
Both types remove any external versions of the variables from the scope.
The
=assigns a null value to the variable, whereas the bare form leaves the variable unset.For example:
Output:
You can see the section:
is different for A and B.