I somehow messed up my bashrc under /etc/bash.bashrc when I was trying to set Maven and Java home variables. Now when I open my terminal, it complains that it cannot find /usr/bin. I'm not able to remove the PATH variable that I have set when trying to set Java and Maven home. Now I'm even not able to execute the sudo command. Is there a way to edit this file and restore everything?
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Incidentally, on a RedHat/Fedora system, the master bashrc comes from the RPM named "setup". You'd have to forcibly reinstall it or install to an alternate location and copy the /etc/bashrc original file from the alternate location.
Of course, all of the above requires that you be running as root.
An IDE is no substitute for an Intelligent Developer.
Most Unix systems allow you to boot into single user mode at the time you boot the computer. However without knowing anything at all about what flavor of Unix / Linux / ... it is difficult to advise on how to do this.
Both Grub and LILO allow single-user boots as long as you haven't disabled the ability to edit the boot directives. Just add "single" to the list of options on the "kernel" directive.
My normal panic recovery is just to boot off a Fedora/RedHat/CentOS install cd/dvd and when the intial screen displays, type in "linux single" at the prompt. That way I can modify files that would be difficult to maintain if I was actually running under them.
Incidentally, the original messages indicated that the variable name wasn't provided on an export command. That is, instead of
it was coded incorrectly as
Actually, I suspect that there was a directory named "Apache Foundation", and it's possible that the actual offending statement was more like
which I think would be interpreted as 2 separate exports separated by the blank in the directory name "Apache Foundation"
This is why "user friendly" names with embedded spaces in them are bad.
If you absolutely positively insist on spaces in pathnames, code the directive like one of the following:
The one with quotes around it is somewhat safer for most of us.