I need to concatenate two variables to create a filename that has an underscore.Lets call my variables $FILENAME and $EXTENSION where filename is read from a file.FILENAME=HelloEXTENSION=WORLD.txtNow...I have tried the following without success:NAME=${FILENAME}_$EXTENSIONNAME=${FILENAME}'_'$EXTENSIONNAME=$FILENAME\\_$EXTENSIONI always get some kind of weird output. Usually the underscore first.I need it to beecho $NAMEHello_WORLD.txt
Concatenating two variables with an underscore
bash;shell script
You can use something like this:NAME=$(echo ${FILENAME}_${EXTENSION})This works as well:NAME=${FILENAME}_${EXTENSION}