|
The code is making sure that if the pid variable is unset it becomes null (or zero-length).
unset and null are different. null means that variable exists in memory and is "", unset means bash never heard of it before.
In coding, whenver you create a new variable you want to set it to a known state. In C you set a string to be zero-length, an integer to zero. This is the same idea.
|