I am using this
DATE_FOLDER=$(date +"%b-%d-%a-%G")
FILENAME="HOME_$date1.tar.gz"
echo $BACKUP_DESTINATION/$DATE_FOLDER/$FOLDERNAME_$FILENAME
My output is
home/May-04-Wed-2011/HOME_May-04-0718PM-2011.tar.gz
but if I use -
instead of underscore _
echo $BACKUP_DESTINATION/$DATE_FOLDER/$FOLDERNAME-$FILENAME
then my ouput is correct
/home/May-04-Wed-2011/vmware-HOME_May-04-0717PM-2011.tar.gz
Why is that?
_
is a valid character for a variable name, and $FOLDERNAME_
doesn't exist.
echo "$BACKUP_DESTINATION/$DATE_FOLDER/${FOLDERNAME}_$FILENAME"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With