Hi,
During an install script I modify the config file several times renamed as conffile.cfg_new. Each time I need to restore it to conffile.cfg.
INSTALLDIR=/app/MyAPP
USERNAME=bianca
RESTORE='rename conffile.cfg_new conffile.cfg ${INSTALLDIR}/conffile.cfg_new'
#example
sed -e "/\[Service\]/,/^[^#][:space:]*UserName =/ s-\(^[^#][:space:]*UserName = \)\([^#]*\)-\1$USERNAME-1" \
$CFGFILE > "${CFGFILE}_new"
$RESTORE
And call $RESTORE each time I modify the file (with sed awk etc)
But the RESTORE variable doesn't take the value of the ${INSTALLDIR} and the rename is not done.
Thank,
Bianca