Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix .bash_profile when Terminal won't work

I was trying to customize my prompt in Terminal. To do this, I tried to edit .bash_profile using vim, but ended up with a .bash_profile.swp file. Following some posts I found online, I used the :recover command in vim, which created a new .bash_profile and then deleted the .swp file. However, now Terminal does not seem to work. When I open it, I get the below message:

-bash: c: command not found

-bash: end: command not found

[Process completed]

Does anybody know how to fix this?

like image 622
JChlip Avatar asked Sep 12 '12 21:09

JChlip


1 Answers

Something in your .bash_profile isn't as it should be. You seem to have a c and an end in it that bash interprets as command. If you post the contents of the file (without comment lines) either here or in a pastebin we'll probably be able to tell you where exactly those are.

Pressing Cmd+Shift+. in the file open dialog of TextEdit (or a real editor) should display dot-files in the dialog.

like image 177
Ansgar Wiechers Avatar answered Oct 21 '22 21:10

Ansgar Wiechers