-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC3024
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
(or "In dash, ... is not supported." when using dash
)
var="Hello "
var+="World"
var="Hello "
var="${var}World"
Using +=
to concatenate to an existing variable is a ksh/bash extension. For POSIX sh or dash, write out the full expression. Be careful to use braces if the text you append could be confused for a variable (as in the example, to avoid $varWorld
being interpreted as ${varWorld}
)
None.
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!