Strange shell behaviour -


here simple bash script:

a="asd" b="qf" echo "$a.$b" echo "$a_$b" 

it's output is:

asd.qf qf 

why second line not "asd_qf" "qf"?

because haven't defined variable named a_. second printout work, use:

echo "${a}_$b" 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -