4 ms·
No. I'm not sure what the "-" is doing in "${TERM-}", but if $TERM was for example set to "-z stringhere" then that would be interpreted as two arguments to "[[
by Lt_Riza_Hawkeye 6y ago
No. I'm not sure what the "-" is doing in "${TERM-}", but if $TERM was for example set to "-z stringhere" then that would be interpreted as two arguments to "[[" instead of one, and would ensure that it always returns false, for example
- vbernat 6y agoThe "-" is here to not error when the variable does not exist (as the topmost set is configured to trigger error on unset variables). It is meant to substitute the (empty) string on the right if the left variable does not exist.