Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .bash_profile, and its giving me an error "Unexpected end of file" I have no clue whats wrong, here it is,

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc

# User specific environment and startup programs
export PS1="\u@\h\\$"

export PATH

It shows syntax error at line 11. But there is no line 11?...

Also, its not setting my ps1, but I'm supposing thats because the unexpected end of file.

share|improve this question

closed as too localized by quanta, Michael Hampton, HopelessN00b, mdpc, Iain Dec 24 '12 at 7:43

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Do you write it on the Windows and upload to the Linux? – quanta Dec 24 '12 at 6:08
@quanta Yes. Using dreamweaver – Necro. Dec 24 '12 at 6:08
I just tried seeing if there was an extra line using the vi command, but it showed only 10 lines. Very weird. – Necro. Dec 24 '12 at 6:09
Google: Windows vs. Linux newline. – quanta Dec 24 '12 at 6:09
Whilst bash is generally considered topical here, using dreamweaver on windows and uploading to unix isn't something a sysadmin would do. You'll probably find the answer to your dilema here. – Iain Dec 24 '12 at 7:47

So, I believe there are special characters in your file.

You can check the same by using vim, instead of vi

Or if you open the file in vi, you can use this command to see the special characters.

:set list

After fixing it, you can use this command to get back to normal viewing mode

:set nolist

Once you remove the special characters, it should work fine.

Also, if you have emacs installed, that can also help you in the same, though I love vim and would always like to stick with that :)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.