assignment 22
Budget: $8 – $15 USD
Task 2
Complete script assignment22 that:
Show the usage statement if 2 arguments ARE NOT passed to the command. "Usage: must enter two arguments at the command line."
Checks to see if the first argument is a file that exists and is readable.
If it is, display "I see <filename2>."
If it is not, then check to see if the second argument is a file that exists and is readable.
If it is, display "I see <filename2.>"
If it is not, display "I do not see <filename1> or <filename2>."
Sample Output
=================== no arguments
Usage: must enter 2 arguments at the command line
=================== /blah /nop
I do not see /blah or /nop.
=================== /etc/shadow /nop
I do not see /etc/shadow or /nop.
=================== ~dkitchin/books/Flatland.txt /nop
I see /home/faculty/dkitchin/books/Flatland.txt
=================== /blah /etc/shadow
I do not see /blah or /etc/shadow.
=================== /blah ~dkitchin/books/Flatland.txt
I see /home/faculty/dkitchin/books/Flatland.txt
=================== ~dkitchin/books/Flatland.txt ~dkitchin/books/Dracula.txt
I see /home/faculty/dkitchin/books/Flatland.txt
Complete script assignment22 that:
Show the usage statement if 2 arguments ARE NOT passed to the command. "Usage: must enter two arguments at the command line."
Checks to see if the first argument is a file that exists and is readable.
If it is, display "I see <filename2>."
If it is not, then check to see if the second argument is a file that exists and is readable.
If it is, display "I see <filename2.>"
If it is not, display "I do not see <filename1> or <filename2>."
Sample Output
=================== no arguments
Usage: must enter 2 arguments at the command line
=================== /blah /nop
I do not see /blah or /nop.
=================== /etc/shadow /nop
I do not see /etc/shadow or /nop.
=================== ~dkitchin/books/Flatland.txt /nop
I see /home/faculty/dkitchin/books/Flatland.txt
=================== /blah /etc/shadow
I do not see /blah or /etc/shadow.
=================== /blah ~dkitchin/books/Flatland.txt
I see /home/faculty/dkitchin/books/Flatland.txt
=================== ~dkitchin/books/Flatland.txt ~dkitchin/books/Dracula.txt
I see /home/faculty/dkitchin/books/Flatland.txt