Found a swap file by the name ".bash_profile.swp"

I am new to Mac and trying to figure out why my .bash_profile is not working. As I read suggestions, I try them. Here is my latest issue:


E325: ATTENTION
Found a swap file by the name ".bash_profile.swp"
owned by: Brian dated: Fri Apr 10 22:09:01 2009
file name: ~Brian/.bash_profile
modified: YES
user name: Brian host name: brian-principes-macbook.local
process ID: 655
While opening file ".bash_profile"

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r .bash_profile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".bash_profile.swp"
to avoid this message.

Swap file ".bash_profile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:


Any suggestions?

MacBook, Mac OS X (10.5.6)

Posted on Apr 11, 2009 6:37 AM

Reply
2 replies

Apr 11, 2009 7:57 AM in response to BP911

I am new to Mac and trying to figure out why my .bash_profile is not working. As I read suggestions, I try them. Here is my latest issue:
E325: ATTENTION
Found a swap file by the name ".bash_profile.swp"
owned by: Brian dated: Fri Apr 10 22:09:01 2009
file name: ~Brian/.bash_profile

That is NOT a Mac thing, it is an Open Source Vim (which is often the default vi editor) thing. You will get this kind of behavior on any system when using Vim.

You can get this for 2 reasons. First if you are actually editing this file from another terminal session. Second, if the previous Vim editing session terminated from unnatural causes.

If you think it was from unnatural causes, then you select Recover. Save your changes :w and exit from the Vim :q

The next time you launch Vim for that file the .swp file will still exist, but this time you can choose Delete, as you have saved your recovered work the previous session.

If you are uncomfortable using vi/Vim editors, then may I suggest you try the nano editor. It will get the job done, but unlike Vim, nano is not as overloaded with features that take a long time to learn and master.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Found a swap file by the name ".bash_profile.swp"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.