?
Solved

/root/.bashrc error

Posted on 2006-06-22
8
Medium Priority
?
1,101 Views
Last Modified: 2011-08-18
Hi, I thought I made a very serious mistake.

I modified /root/.bashrc using vi and adding some path in it like:
export JAVA_HOME=/opt/jdk1.5.0_07
export PATH=/opt/jdk1.5.0_07/bin
Now, I am not able to use vi, chmod, cp, mv, cd /root...etc

Does there have anyway I can recover the file?

I use fedora core5.
0
Comment
Question by:ddlam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 15

Expert Comment

by:DonConsolio
ID: 16962562
try:

/bin/mv .bashrc .bashrc.old
0
 
LVL 5

Assisted Solution

by:csgeekpyro
csgeekpyro earned 200 total points
ID: 16962577
change the PATH line to read and everything should be fine:

export PATH=$PATH:/opt/jdk1.5.0_07/bin

Then just run:

source ~/.bashrc

0
 
LVL 15

Assisted Solution

by:DonConsolio
DonConsolio earned 200 total points
ID: 16962593
the correct setting would be:

>export JAVA_HOME=/opt/jdk1.5.0_07
ok
>export PATH=/opt/jdk1.5.0_07/bin
PATH="$PATH:/opt/jdk1.5.0_07/bin"
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Accepted Solution

by:
kblack05 earned 1400 total points
ID: 16962741
You need to add the server environment to the path. In your path statement of the .bashrc make sure you include not only the paths you need but the server path also:

PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:/opt/jdk1.5.0_07/bin

Regards,

~K Black
0
 
LVL 5

Expert Comment

by:csgeekpyro
ID: 16963184
In an FC5 system, those paths are already in the $PATH var when .bashrc is sourced.  Most likely, he was editing the script and forgot to replace the $PATH token in the export statement.  I've made that mistake myself.
0
 
LVL 5

Assisted Solution

by:arvind
arvind earned 200 total points
ID: 16967110
type following on root prompt

export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/opt/jdk1.5.0_07/bin


0
 
LVL 9

Author Comment

by:ddlam
ID: 16970744
Thanks all nice guys very much. I am ready to reinstall whole system but your answers sloves my big troubles.

I set the path
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:/opt/jdk1.5.0_07/bin

then correct ~/.bashrc

It works fine now.
0
 
LVL 11

Expert Comment

by:kblack05
ID: 16970795
I'm not sure why you would want to re-install the system...

Another handy trick here is to use the 'env' command piped to less

env | less

or even to grep

env | grep -i PATH

You would have seen that the path looked very short before.

Thanks and good luck!
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question