I'm currently working on a very simple script in preperation for my final exam today. I can get the basic command to run no problem however the proff wants extensive error checking done which i for some reason cannot get to happen.
to run the script it is suppose to read:
./script_01.sh -i file1 -o file2
If all that is present it will copy file1's contents to file2.
if there is less than 4 arguements it has to output errorlevel x.
if there is more than 4 or no arguements it outputs error lvl y or z.
If -i or -o are not exactly that it outputs a different error. (they are meaningless switches).
here is hte script i have so far:
http://puu.sh/2Co6VSorry ic an't make it an image for some reason this forum doesn't support puush.
The error it gives me right now is line 19, unexpected token "else".
I can't get it to do anything with all these error checks whether i have no arguements, the correct amount but something missing, or everything appropriate to what it should be.
Any help is appreciated.
My main question is why line 19 is unexpected. It is the else in response to line 11