problem using variables in bash script

I am using variable to give the location of the file I am using but I get error.
Here is the code:

LogFile=/tmp/log.email
echo -e "could not close the service - error number $error \n" > $LogFile

well this is not all the code but is enough because the problem start when I try to use the variable.
In this is one example.
Why does it happen and how can I fix it?

LogFile="/tmp/log.email"

1 Like

thanks, it worked.

I wonder why that worked, because there is no difference between

LogFile="/tmp/log.email"

and

LogFile=/tmp/log.email