[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

/root/.bashrc error

Posted on 2006-06-22
8
Medium Priority
?
1,109 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

649 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