2

I was trying to make some changes with PATH (mostly add a new PATH) to my .bash_profile and the last line entered was source .bash_profile.

After I saved and restarted the Terminal app, instead of the shell prompt I see PATH values continuously popping up on my Terminal window tab. Only CTRL+C will kill it but now I see 'Application Closed' message and that's the end of it. What do I do to restore the shell back to my previous status? I tried running the repair permissions under Disk Utility but that didn't seem to fix my issue.

Thanks in advance.

enter image description here

3

You should remove the line:

source .bash_profile

from your .bash_profile. This line is causing the infinite loop by continuously loading the file. As you have discovered, repairing permissions will not solve this issue.

Since you can't access terminal, you can edit your .bash _profile in TextEdit. Here's how to do so:

  1. Open TextEdit Application and select Open (under File).
  2. Navigate to your home folder.
  3. .bash_profile will not be shown by default, since it begins with a period and is hidden. Type Cmd-Shift-. to view all hidden files.
  4. Then, open up your .bash_profile and remove the source .bash_profile line.
  • You can create a new terminal with shell customizations disabled using Shell > New Command… to run the command bash --noprofile. Then you can edit your shell startup script(s) using your usual tty-based editor. – Chris Page Oct 23 '14 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .