Homework 10: Bash scripting
2013-04-16
May 8, 11:59PM
Do the work listed below in your home directory on our server, and send an
email to me at jal2016@email.vccs.edu with subject CSC 185 HW10 when
you're done.
- Create a folder called
hw10
in your home directory. Change permissions to
ensure that no one besides you can see inside it, and do the rest of your
work in that folder.
- Create a script called
hello
that takes a single name as an argument and
prints a greeting to the name. For example, running hello Joel
should
print "Hello Joel!".
- Create a script called
backup
that copies a file to a new name that
incorporates the current date. For example, something like renaming
file1.txt
to file1.txt.backup-2013-04-30
. Run man date
to see how
to get the current date in a format that you would like.
- Create a script called
recycle
that acts as a somewhat safer replacement
for the rm
command, moving the input files to ~/RECYCLE-BIN
instead of
deleting them. Optional: have your command keep a log of the original
locations of each file, in order to let you undelete them back to their
original locations later.