![]() |
| ||
| Shell Scripting Problem Hey guys .. I am pretty new to Shell Scripting. I was hoping if some one could help me out with my problem. I am going with a tutorial for shell scripting. While executing some of the programs and commands I am getting errors. I have also checked other sites and tutorials for the same, but everything seems intact. Following is the code. When I execute this (after changing the permission - 755), I get an error saying "unexpected end of file", Now I am not sure why this is happening ... please help me out. Thanks in advance Regards, A Kris %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| ||
| Re: Shell Scripting Problem Im guessing it's because on your last line of the program you have an extra " after fi. |
| ||
| Re: Shell Scripting Problem There also seem to be a number of unnecessary backtick characters after a few then and else statements. That could be causing it. Best wishes, Mike |
| ||
| Re: Shell Scripting Problem |
| ||
| Re: Shell Scripting Problem Good point. Totally looked right past that. There are spaces to the left and right of all the assignment (=) operators... WOW :) , Mike |
| ||
| Re: Shell Scripting Problem Quote:
if [ $# -it 10];then`Spaces in the if statement between if and [ ] are important. They need to be respected. With that in mind I leave if[ $isdef -eq 0];then`for you to figure what's wrong with it. echo "Animal name is $na, age is $age, sex is $sex, weight is $weight (demo mode)"Before using the demo mode, those variables need to have something assigned to them since the user hasn't assigned anything. |
| ||
| Re: Shell Scripting Problem Guess I got mislead by the error message.. :) I'm surprised a script with so many errors didn't generate a much different one other than unexpected EOF ;) ,Mike |
| All times are GMT -4. The time now is 5:17 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC