Your task is to create a tcsh shell script that is able to backup all the C program files in your current directory.
The algorithm is as follows:
• If a backup directory does not exist, then prompt the user if they would like to make one.
• If the user responds "y" or "yes" in either capitals or lowercase, then make the backup directory (in your current working directory)
• If the user responds "n" or "no" in either capitals or lowercase, then produce a message that no directory was created
• otherwise, print a message that an invalid response was entered
• If the backup directory exists
• For each .c file:
• If there have been changes to the file since the last backup, then copy the current .c file to the backup directory
• Else (if no copy exists in the backup directory) copy it
• (Otherwise, no copy will be made)
The following is a shell script that makes backups to a "backup" directory in your home directory:
You might want to take ideas from it, but note that it does not prompt you if you would like to make the directory.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.


set backupDir=backupdir

echo "remove backupdir"
if ( -d $backupDir ) then
   rm -r $backupDir

ls -l

echo "Type NO"
./ # Type "NO" to creating a backup directory
echo "Type n"
./ # Type "n" to creating a backup directory
echo "Type up"
./ # Type "up" to creating a backup directory
echo "Type yes"
./ # Type "yes" to creating a backup directory

ls -l $backupDir

echo "remove backupdir"
rm -r $backupDir

echo "Type Yes"
./ # Type "Yes" to creating a backup directory...
$30.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Linux Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats