The expression ${SOMETHING='value'}
sets SOMETHING to value
if it isn't already set. This is a useful operator to have in many situations. However, it also returns the assigned value, so if you simply executed
${SOMETHING='value'}
then your shell would try to invoke the command value
. This might or might not do something unwanted; at the least it would throw a message "value: command not found".
To avoid this you can use the no-op :
, which evaluates its argument and then throws it away, rather than executing it. This is documented here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…