I need to create a UNIX program for this assignment
In this assignment, you are to create an "archive" utility. It is a simple way to have some version control. You've created software projects before that change and grow over time. You might have several different copies of it (let's assume that it's all in one file). Perhaps before making major changes, you make a back-up copy, in case you later decide to revert to the earlier version. The idea is this: make a shell script program, called archive, that creates a back-up version of a file.
Notes:
Snehanshus-MacBook-Air:Desktop snehanshusuman$ cat archive.sh
inputfile=$1
currentdate=`date +%m-%d-%Y`
mv $inputfile $inputfile-$currentdate
Snehanshus-MacBook-Air:Desktop snehanshusuman$ touch test
Snehanshus-MacBook-Air:Desktop snehanshusuman$ ls -lrt test
-rw-r--r-- 1 snehanshusuman staff 0 Oct 3 16:05 test
Snehanshus-MacBook-Air:Desktop snehanshusuman$ ./archive.sh test ###name of the file you want to archive.
Snehanshus-MacBook-Air:Desktop snehanshusuman$ ls -lrt test*
-rw-r--r-- 1 snehanshusuman staff 0 Oct 3 16:05 test-10-03-2020
Please let me know if I misunderstood the requirement.
Get Answers For Free
Most questions answered within 1 hours.