[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: unexpected end of file

Ethan you were partially correct in your reply.

When I comment out the if structure that tests for the
existence of .bashrc, and 'sources' it if it does exist,
there are no problems. That is, I can source the file 
without any problems.

However the problem seems still to be elsewhere. 

When I uncomment the if structure I am able to run the file as
an argument to bash, i.e "bash .profile" or, after changing
the files permissions, as a shell programme "./.profile". 
This suggest (to me at least) that the problem is not one 
of syntax.

It looks like something is broken. 

I have tried creating and then sourcing simple shell scripts 
and they suffer from the same problem.

Do you or anyone else have any sugestions?

TIA and thanks for your previous reply.

>Its probably not as complicated as you are making it, more likely 
>there is just a stray " or something
>if there are any if then structures make sure they are terminated 
>with a fi, all { have a matching } and so on.
>all it takes is one stray " ' or ` to cause that, bash keeps looking 
>for the closing quote, or the fi or whatever and if it gets to the 
>end of file it complains.

Reply to: