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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -