Write a shell script (in any shell you like) with the following descriptions:CS476/576
Assignment #1
Due Midnight, Tuesday Sept 18, 2001
NAME
SYNOPSIS
del - Delete Files
undel - Un-Delete Files
del <File names>DESCRIPTION
undel <File names>
The undel command
restores a file f under $HOME/@/d/f
and
puts it under
directory d
Both commands accepts any number of file names.
The following are examples
of using these two commands.
Examples:
% pwd
% /home/wahab/cs476/assignments/a1
% rm f* k*
% ls f* k*
% touch f1 f2 k1 k2 k3 //To
make sure these files exists
% ls f* k*
f1 f2 k1 k2 k3
% del
f* k*
The following
files will be deleted:
f1 f2
k1 k2 k3
Do it?
(y/n): n
Fine....will
not delete.
% del
f* k*
The following
files will be deleted:
f1 f2
k1 k2 k3
Do it?
(y/n): y
Ok....
Current
Directory:
/home/wahab/cs476/assignments/a1
Restoration
Directory:
/home/wahab/@/home/wahab/cs476/assignments/a1
Done.
% cd /home/wahab/@/home/wahab/cs476/assignments/a1
% ls f* k*
f1 f2
k1 k2 k3
% undel
f* k*
The following
files will be restored:
f1 f2
k1 k2 k3
Do it?
(y/n): n
Fine....will
not restore.
% undel
f* k*
The following
files will be restored:
f1 f2
k1 k2 k3
Do (y/n):
y
Ok....
Restoration
Directory:
/home/wahab/@/home/wahab/cs476/assignments/a1
Original
Directory:
/home/wahab/cs476/assignments/a1
Done.
% cd /home/wahab/cs476/assignments/a1
% ls f* k*
f1 f2
k1 k2 k3
%
mkdir, mv