Quote:
Originally Posted by Tinkster
Code:
var3=${var1}${var2}
?
|
That is never wrong but the { } is only necessary when the character after the variable name is a valid name character. According to the DEFINITIONS section of the bash man page, a name is "A word consisting only of alphanumeric characters and underscores, and beginning with an alphabetic character or an underscore". That does not include $ so variables can be concatenated by $var1$var2$var3 (providing that whatever follows var3 is not an alphanumeric character or underscore).