I need to concatenate 2 string variables in bash on my Centos 6 machinefor f in *.tar.gz;dobasename ${f%.tar.gz}echo $basenamedbaddress='mysql/*.sql'path=${basename}${dbaddress}  echo $pathtar -zxvf $f $pathdoneThe script should extract all .sql files inside basename/mysql/ directory.But the output of my code is as follows:basenamemysql/*.sqltar: mysql/*.sql: Not found in archivetar: Exiting with failure status due to previous errorsAs you see, the $basename is not prepended to $dbaddress .Am I missing something?
Unable to Concatenate 2 Variables
bash
You are referencing the basenamevariable (with $basename), but are never assigning it to anything, which means it reads to bash as a null string.  You might need to try basename=${f%.tar.gz}.