CS256 - Assignments



Assignment #1: Due Wednesday Feb 9 - 11:59pm
To submit: email the script file to kobti@uwindsor.ca with subject "256ASSIGN1 STUDENTNUMBER" (replace STUDENTNUMBER with your own ID).

Write a C-shell script called backup, with the following synopsis:
backup [-s size] [-d target_directory] <filename list>
What is between [ and ] is optional whereas what is between < and > is not; note that the brackets are not part of the input.
The script backups all files in the local directory with the file names list given in .
When the -s size option is used, only files that are larger than size bytes will be backed-up.
Target directory, if specified using -d, must exist (check for it!). If -d is not specified then use the current working directory as target.

Examples:
backup -s 100 -d ~/backup file1 file2 256/*.c
Will create a backup copy by appending .bak extension to a copy of each of file1, file2 and all files with the extension .c in the local directory 256, and place the copies in the directory "backup" inside the home directory of the current user. Only files that exceed 100 bytes are copied.
backup
Usage:  backup [-s size] [-d target_directory] <filename list> 

backup myfile
would create a copy of myfile called myfile.bak in the current directory.