How to recover .profile on Mac OS?
Show hidden files in Finder. Then you can either fix the problem in TextEdit, or simply remove/rename the file. There is no default ~/.profile on Mac OS X, only a global /etc/profile (and you may also have a ~/.bash_profile).