Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I really need some major help with this Lab Exercise, I need to write a shell script to accept a file name and a directory name from the user. The script should check whether both the file and the directory exist on the disk, if they do, then the file has to be copied to the specified directory. Display error messages when any of the above conditions are not met.
Ok this is the scoop, we havent had any training and have rather inadequate information from our NIIT textbook on how to compose this sort of shell script... can anyone help me out with this and additionally suggest resources for further study later on.
I need this by the next couple of days.
Thanks Much,
Sass

Here's a start.
#!/bin/sh
if [ $# -ne 2 ] ; then
echo "ERROR. Usage $0 dirname filename"
exit 4
else
echo "Insert code here"
fiO'Reilly has a great book on the korn shell. It's been a great desk side reference for me.
http://www.oreilly.com/catalog/korn2/
Also "The Linux Documentation Project" has a nice how-to guide at:
http://www.tldp.org/LDP/abs/html/
Ziff-Davis has a nice overview of some of the things you can check for with the shell.
http://www.zdnet.co.uk/help/tips/story/0,2802,e7108431,00.html

![]() |
sis900 module (cont. from...
|
where to get debian?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |