Hi guys
I am a new UNIX environment user who's got troubles trying to make scripts on a VMWARE virtual machine.
If I use "if" conditions or "for" loops on the shel using the fallowing syntax everything goes well:
$ if condition
> then
> commands
> else
> commands
> fi
But when I put it into a script, when I try to run it, is like if the "then" and "fi" statements where not seen by the VM. And the shell shows messages such as "syntax error" or "uncorrect end of file".
To get rid of these errors, I am obliged to use the following syntax:
if condition; then commands; else commands; fi;
or
if condition; then
commands
else
commands
fi;
And I don't understand because I thought I was not allowed to put a ";" after the "fi" statement.
I also have troubles with arithmetics expressions. I don't understand why the expressions I found in books or on the web don't work in scripts as they do work on the shell.
Does anyone know where do these problems come from?
Is it me, I may be so bad using UNIX that I didn't find out things?
Is it a bad configuration of VMWARE?
Thank U for your help
PEDROSAN