1

While trying to set Java home, following someone's instructions I edited ~/.bashrc in gedit, putting the java_home script at the end of the file, and then I typed source ~/.bashrc after saving in gedit.

I returned to gnome terminal and now I absolutely cannot get out of bash.

Zanna
  • 70,465
  • 1
    Could you please add a little more detail? What exactly did you do, what did you want to achieve and what happened instead? Did you encounter any warning or error messages? Please reproduce them in their entirety in your question. (see How do I ask a good question?) – David Foerster Sep 12 '16 at 20:12
  • No warning or error I was following someone's instructions I can't remember exactly but... I ran ~/.bashrc and ended up in gedit and then ran the java_home script at the end of the file in gedit and then I typed source ~/.bashrc after saving in gedit I returned to gnome terminal and now I absolutely cannot get out of bash – nexogen.io Sep 12 '16 at 20:16
  • Please [edit] your question if you want to add or clarify something. I'm still having a hard time to decipher the sequence of events. Maybe you can format them as an ordered list in your question to both sort your thoughts and use the text layout and structure as a support for the reader to follow them. – David Foerster Sep 12 '16 at 20:35
  • I'm simply too frantic and frustrated at this point... I ran a bash script from gnome terminal now I cannot EXIT the bash script via gnome terminal. When I open gnome terminal I no longer get my normal profile. Instead It opens in BASH. The gnome terminal no longer functions the way it did before I ran the bash script. The gnome terminal is stuck in a BASH shell. How do I exit the bash shell and return to my normal gnome terminal profile? – nexogen.io Sep 12 '16 at 20:39
  • Please calm down, go do something else for an hour or two. It's going to be very difficult to help you as long as you're this incoherent. – David Foerster Sep 12 '16 at 20:43
  • Perhaps we can chat on Hangouts in an hour? I really hope I didn't destroy my build I worked so hard on. Hopefully you can help. – nexogen.io Sep 12 '16 at 20:44
  • You can find me on Hangouts via Google+ name Michael Jordan not a joke you can search nexogen as well – nexogen.io Sep 12 '16 at 20:46
  • I don't have a Google account and this site is not a help desk nor do I intend to behave like it is. If you want to help us answer your question, [edit] it to include a detailed, straight-forward description of the sequence of events. – David Foerster Sep 12 '16 at 20:57

1 Answers1

3

I'm not sure what you put in your .bashrc but I suspect it is sourcing itself recursively. To reset it to the default, use a GUI method, since you can't use the command line.

The most reliable way would be just to overwrite your broken .bashrc with the system default version.

  • Open Nautilus (the file browser)
  • under View click Show hidden files.
  • Rename your .bashrc to something else like bashrcbroken.
  • Navigate to the directory etc in filesystem
  • go into the etc directory and then go into the skel directory.
  • Right click & copy the file .bashrc.
  • Go back to your user home directory and paste the file there, replacing the old .bashrc file.

Open a new terminal.

Zanna
  • 70,465
  • You are the only one who seems to get what I am talking about omg this is beyond aggravating... I added java_home environment variable to .bashrc as this is what so many said to do... I have been using Linux for years and I stopped for a while and now I'm in bash hell I forgot what to do... I used to go in and out of bash all the time... I have no idea why it is so difficult... – nexogen.io Sep 12 '16 at 20:43
  • have you fixed it now @nexogen.io ? Yes, a lot of people seem to have problems with this - I see some strange looking tutorials and commands floating around – Zanna Sep 12 '16 at 20:45
  • No I am having a lot of issues – nexogen.io Sep 12 '16 at 20:47
  • Did you try what I suggested and it didn't work @nexogen.io ? – Zanna Sep 12 '16 at 20:48
  • I found a .bash_logout in skel I'm about to write this in the term... If that is it I'm going to scream because I think it is – nexogen.io Sep 12 '16 at 20:48
  • 1
    no don't do that, just copy .bashrc from skel and paste it in your user home directory, overwriting the old .bashrc that is there @nexogen.io – Zanna Sep 12 '16 at 20:50
  • Your method worked! Thank you!!!! Now I am still trying to figure out Java_home issue – nexogen.io Sep 12 '16 at 20:57
  • @nexogen.io my pleasure - see this question for how to set JAVA_HOME (hint - not in .bashrc) – Zanna Sep 12 '16 at 20:58
  • @nexogen if this answer worked you can mark it as accepted by clicking the tick marks – Anwar Sep 12 '16 at 21:09