d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Unity Shell
1235Next
Closed New Topic New Poll
Member
Posts: 9,718
Joined: Jan 29 2007
Gold: 0.00
Apr 18 2013 09:06am
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/2Co6V

Sorry 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
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 18 2013 03:28pm
Nvm, if your line 19 is supposed to CLOSE line 11's IF block, then you placed the FI for the third IF block at the wrong place.

should be a FI at line 18 (and delete the one at 28) (assuming this works somewhat similar to kornshell)

This post was edited by Eep on Apr 18 2013 03:34pm
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 18 2013 03:37pm
Quote (AbDuCt @ Apr 18 2013 04:35pm)


welp that's that....
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Apr 18 2013 03:39pm
Quote (Eep @ Apr 18 2013 04:28pm)
Nvm, if your line 19 is supposed to CLOSE line 11's IF block, then you placed the FI for the third IF block at the wrong place.

should be a FI at line 18 (and delete the one at 28) (assuming this works somewhat similar to kornshell)


Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 18 2013 03:43pm
Quote (0n35 @ Apr 18 2013 04:39pm)
http://diablo.incgamers.com/wp-content/uploads/2012/09/Genius.jpg


Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Apr 18 2013 03:45pm
Quote (Eep @ Apr 18 2013 05:43pm)
http://img836.imageshack.us/img836/1997/level78c482579.jpg


s/in/during
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 18 2013 03:52pm
Quote (AbDuCt @ Apr 18 2013 04:45pm)
s/in/during


did On35 ever let go?
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Apr 18 2013 03:53pm
Quote (Eep @ Apr 18 2013 05:52pm)
did On35 ever let go?


what?
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Apr 18 2013 03:53pm
Quote (AbDuCt @ Apr 18 2013 04:53pm)
what?


let go of your nuts
Go Back To Programming & Development Topic List
1235Next
Closed New Topic New Poll