I'm running a bash shell. version 2.05b I would like to be able to load a commandline into an environmnetal variable and then runn the command using that variable.
It seems to work OK until I get special characters in the commandline. For instance
runs just fine!! But
fails!
Looking at the results of "set -x" shows that the redirects are being put in single quotes. How do I escape the redirects?
It seems to work OK until I get special characters in the commandline. For instance
Code:
REMOVECOMMAND="rm -f $DESTINATIONDIR/$SOURCEHOSTNAME/$TARFILENAME{,.gz}"
$REMOVECOMMAND
Code:
BACKUPCOMMAND="tar -cf $DESTINATIONDIR/$SOURCEHOSTNAME $TARFILENAME $SOURCEDIRECTORY > $DESTINATIONDIR/$SOURCEHOSTNAME/$LISTNAME 2>>$MAILFILE"
$BACKUPCOMMAND
Looking at the results of "set -x" shows that the redirects are being put in single quotes. How do I escape the redirects?