Help: Backfile if backup does not exist

view full story

http://www.unix.com – I am trying to work on a script that will first check to see if a backup of a file exists, and if it does it will prompt the user to ask if he/she wants it replace. Of course, if the user says no then the file should be skipped. Here is the code I have written. Does it look as if it is working correctly? Code: #! /bin/bash echo "Beginning backup of files..." # Check to see if files exist if [ -f /home/user/Documents/backup.tar.gz ]; then     read -p "Backup file already exists. Replace (y/n)?"     [ "$REPLY" != "y" ] || tar (HowTos)