bad .profile affecting my terminal adversely

Joined
Jan 25, 2017
Messages
8
Reaction score
0
In the pursuit of a tricked out terminal prompt, I was messing around with my .profile and .bash_profile ... Now, my terminal will open, but it is running a process in an infinite loop looking thing. if I hit Ctrl + C it stops the process, but won't accept any commands, so i can't get to that .profile to fix the problem.. What can I do? Is replacing the operating system the only answer???
 

Attachments

  • Screen Shot 2017-01-24 at 12.22.55 PM.png
    Screen Shot 2017-01-24 at 12.22.55 PM.png
    176.6 KB · Views: 337
Joined
Sep 17, 2014
Messages
4,854
Reaction score
241
A couple of things we need to know are:

1. What exact Mac model do you have?

2. What exact Mac OS are you using?

3. Have you ever done any disk cleanup/maintenance/repairs?

4. Are you making backups to an external device? If so, what software are you using?
 
Joined
Nov 14, 2012
Messages
2,241
Reaction score
100
Hi,

yes it sounds like the .bash_rc or .profile files got messed up. First check to see if they are still in place by typing the flowing command.
/bin/ls -a

If they are you can back them up with the following.
/bin/mv .bash_rc bash_rc
/bin/mv .profile profile

Then restart terminal to see what happens, if still bad you could try trashing the Terminal preference file.
~/Library/Preferences/com.apple.Terminal.plist

Make sure you are fully backed up first.;)

Thats my best shot.
 
Last edited:
Joined
Jan 25, 2017
Messages
8
Reaction score
0
A couple of things we need to know are:

1. What exact Mac model do you have?
2. What exact Mac OS are you using?

3. Have you ever done any disk cleanup/maintenance/repairs?

4. Are you making backups to an external device? If so, what software are you using?
 
Joined
Sep 17, 2014
Messages
4,854
Reaction score
241
Additionally, how did you "get to" whatever OS you are now using? That is, did you "upgrade in place" from a prior OS, ie, basically having the new OS "overwrite" the prior one?
 
Joined
Jan 25, 2017
Messages
8
Reaction score
0
Hi,
1. MacBook Pro (Retina 15-in, early 2013)
2.7 GHz intel Core i7​
2. Sierra 10.12.2
3. I haven't done any maintenance / repairs .. not sure about cleanups.. probably not..
4. I back up to TimeCapsule ..
 
Joined
Jan 25, 2017
Messages
8
Reaction score
0
Additionally, how did you "get to" whatever OS you are now using? That is, did you "upgrade in place" from a prior OS, ie, basically having the new OS "overwrite" the prior one?
Additionally, how did you "get to" whatever OS you are now using? That is, did you "upgrade in place" from a prior OS, ie, basically having the new OS "overwrite" the prior one?
 
Joined
Jan 25, 2017
Messages
8
Reaction score
0
Thank you for answering my question...
I was able to get back to the previous .profile ( i had saved it with 'rename') by opening TextEdit app and going to 'previous files' and editing the .profile. This is the way I fixed the error... My problem was that I was hell-bent on doing it in bash, which was running in a loop.. so, using TextEdit went around that and took care of problem.
 
Joined
Sep 17, 2014
Messages
4,854
Reaction score
241
Hi,
1. MacBook Pro (Retina 15-in, early 2013)
2.7 GHz intel Core i7​
2. Sierra 10.12.2
3. I haven't done any maintenance / repairs .. not sure about cleanups.. probably not..
4. I back up to TimeCapsule ..

I had typed everything below, then I saw your post about how you solved your problem. That's good. But, you might want to read what I wrote below, and even if you don't do the re-installation of Sierra, it is still good reference stuff, especially if you have issue again.

Also, a new version of Sierra, OS 10.12.3, came out last week. You can download the Combo Updater from here:

https://support.apple.com/kb/DL1905?locale=en_US

OK, thanks for that. However, not doing any disk cleanup on a daily basis, and periodically not doing any disk cleanup/maintenance/repairs is asking for trouble. At least, though, you are using Time Machine for backups. Is that to an external device?

Additionally, how exactly did you upgrade to Sierra? Again, did you just let Sierra "overwrite" whatever prior OS you were using?

And one other thing, are you using any third party software? If you are, some of them might not be compatible with Sierra (assuming you were using such programs prior to upgrading), and thus would need to also be upgraded.

Now, from what I am seeing, it might be best if you do a clean installation of Sierra. The steps involved would be:

1. Go to the App store, and download the latest version of Sierra (V10.12.3 came out last week).

2. Make one more Time Machine backup, and also for the OS 10.12.3 file you download from the App store, "copy" it to another place on your external drive (this might require partitioning the drive, leaving the Time Machine backup as is, but on a new partition).

3. Boot your machine to the (hidden) Recovery HD partition. This link describes how to do that, and what is on that partition:

https://support.apple.com/en-us/HT201314

4. Note the 4th choice on that menu, Disk Utility. Select that, and have it Erase and Format your internal drive.

5. After that is done, select #2, "Reinstall the Mac OS". What I am not sure of is the actual process that entails. Ideally, it would find that V10.12.3 download you did previously. (I do this process entirely different, so that is why I am unsure). Hopefully, that will install the latest version of Sierra, OS 10.12.3.

6. When that completes, I believe you'll be offered the opportunity, via Migration Assistant, to "migrate"/copy needed "stuff" from your Time Machine backup (and thus you would not need to select the first choice on that screen. That choice of Migration Assistant is typically what comes up after an installation on the Mac OS (and that has been my experience, even with the other way I do this process).

7. After completion, restart your machine. You should be good to go.

Also, you really should start doing daily disk cleanup, and periodic disk cleanup/maintenance/repairs. While SSDs have less mechanical parts than a standard HDD, it's still both beneficial and necessary to do disk-related maintenance "stuff". There are both free and commercial products you can use to assist with those tasks. Myself, I use the excellent freeware program Onyx (been around a long, long time, is a solid performer, and has had numerous stellar reviews), and the commercial product TechTool Pro (another excellent mainstay in the Mac "world").
 
Joined
Jan 25, 2017
Messages
8
Reaction score
0
I had typed everything below, then I saw your post about how you solved your problem. That's good. But, you might want to read what I wrote below, and even if you don't do the re-installation of Sierra, it is still good reference stuff, especially if you have issue again.

Also, a new version of Sierra, OS 10.12.3, came out last week. You can download the Combo Updater from here:

https://support.apple.com/kb/DL1905?locale=en_US

OK, thanks for that. However, not doing any disk cleanup on a daily basis, and periodically not doing any disk cleanup/maintenance/repairs is asking for trouble. At least, though, you are using Time Machine for backups. Is that to an external device?

Additionally, how exactly did you upgrade to Sierra? Again, did you just let Sierra "overwrite" whatever prior OS you were using?

And one other thing, are you using any third party software? If you are, some of them might not be compatible with Sierra (assuming you were using such programs prior to upgrading), and thus would need to also be upgraded.

Now, from what I am seeing, it might be best if you do a clean installation of Sierra. The steps involved would be:

1. Go to the App store, and download the latest version of Sierra (V10.12.3 came out last week).

2. Make one more Time Machine backup, and also for the OS 10.12.3 file you download from the App store, "copy" it to another place on your external drive (this might require partitioning the drive, leaving the Time Machine backup as is, but on a new partition).

3. Boot your machine to the (hidden) Recovery HD partition. This link describes how to do that, and what is on that partition:

https://support.apple.com/en-us/HT201314

4. Note the 4th choice on that menu, Disk Utility. Select that, and have it Erase and Format your internal drive.

5. After that is done, select #2, "Reinstall the Mac OS". What I am not sure of is the actual process that entails. Ideally, it would find that V10.12.3 download you did previously. (I do this process entirely different, so that is why I am unsure). Hopefully, that will install the latest version of Sierra, OS 10.12.3.

6. When that completes, I believe you'll be offered the opportunity, via Migration Assistant, to "migrate"/copy needed "stuff" from your Time Machine backup (and thus you would not need to select the first choice on that screen. That choice of Migration Assistant is typically what comes up after an installation on the Mac OS (and that has been my experience, even with the other way I do this process).

7. After completion, restart your machine. You should be good to go.

Also, you really should start doing daily disk cleanup, and periodic disk cleanup/maintenance/repairs. While SSDs have less mechanical parts than a standard HDD, it's still both beneficial and necessary to do disk-related maintenance "stuff". There are both free and commercial products you can use to assist with those tasks. Myself, I use the excellent freeware program Onyx (been around a long, long time, is a solid performer, and has had numerous stellar reviews), and the commercial product TechTool Pro (another excellent mainstay in the Mac "world").
 
Joined
Jan 25, 2017
Messages
8
Reaction score
0
I did not do a clean install of the OS, never have.. it says "update is available" and I click the button and let it do its thing..!! This is a big project for sure, and I appreciate the need to do it. My computer has Never given me any problems in the 4 years I've been using it, surprisingly enough, but I am quite sure I have a big mess. Lately I have been thinking of wiping it all clean, and you have nudged me along in that direction..
Most of my hangups happen because I lack understanding of $PATH variables, and it is slowing down any progress I make in my development aspirations. Thinking of doing this process with the OS may be a serious deviation if I screw it up somehow.. its a little scary!!
 
Joined
Sep 17, 2014
Messages
4,854
Reaction score
241
Understand. That is why I stated every thing out in a clear, step by step, manner. As long as you carefully follow what I wrote, you should be fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top