Help with variable assigning in shell scripts
I am currently making a shell script to back up all my data (/home) to /mnt/hda3. I am having a problem, however, with managing to assign a variable a value equal to the output of a command. right now, this is what the script looks like:
#backup of /home to /mnt/hda7
mount /dev/hda7 /mnt/hda7
cp -r /home /mnt/hda7/$date
echo "Backup: ";ls /mnt/hda7/$date
The problem I am having it that the variable date isn't assigned the value of the output of dat +%m%d%y. Any help would be great!