Good point. Totally looked right past that. There are spaces to the left and right of all the assignment (=) operators... WOW 
, Mike
If it only were that ...
if [ $# -it 10];then`
# ^Wrong ` there
# ^Need extra space there
# ^Probably 1 (one) and not 10
# ^-lt, not -it. Stands for `is less than'
# corrected would be:
# if [ $# -lt 1 ]; then
# meaning: if not arguments where entered show menu
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)"
exit 1 # Not need it
fi'' # Not need it
Before using the demo mode, those variables need to have something assigned to them since the user hasn't assigned anything.
Last edited by Aia; Aug 30th, 2008 at 11:46 pm.
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Offline 2,304 posts
since Dec 2006