In case you'll need more variables and do not want a $1
, $2
... mess:
You must use brackets around the variable name
set output '${molecule}_trans.tex'
because the underscore is a valid character for variable names, and bash
looks for the variable $molecule_trans
, see http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion.