I have a bash code export TM_SCALAC=${TM_SCALAC:-scalac}
.
I'm not sure the meaning of ":-" inside the ${}
.
How do I interpret this line of bash code?
That means if TM_SCALAC
isn't already set, set it to "scalac
".
From bash reference manual:
3.5.3 Shell Parameter Expansion
...
${parameter:-word} If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
:-
mean in a shell script – Ivan Chau Dec 06 '13 at 01:23