LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2013, 05:11 AM   #1
projjwal
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
Unhappy Any command does not execute after setting "export" to .bashrc file


Hi,

Iam not very much comfortable with linux. Currently, i wanted to set the "export" at .bashrc file. Because, when, i fire command like "export JAVA_HOME=/usr/lib/jvm/java-6-openjdk", i see that, the command is only session dependent. That means, when, i re-login, i cant see the JAVA_HOME variable data(echo $JAVA_HOME).

As a matter of fact, i wanted to set the command to .bashrc file, so that, every time, i login to server, i can see the value.

I got a solution for this, from a forum, where they say like,

=======================================
You'll have to add the 'export' line to the .bashrc file for each user. If you want it to be system wide you'll have to log in as root and add the line to the /etc/bashrc file.

Also, you don't need to use an editor, just log in as each user and type:
echo "export LD_ASSUME_KERNEL=2.2.5" >> .bashrc

For system wide, log in as root and type:
echo "export LD_ASSUME_KERNEL=2.2.5" >> /etc/bashrc

===============================================

But when i fired the command "export LD_ASSUME_KERNEL=2.2.5" >> .bashrc", after that any command does not execute.

Even, if i try, "ls", server says,

"ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory"

I have no idea, what is going on. Please help me. I searched many places, but did not find any generic solution for this? Have i done anything wrong ar have to fix something?. Please let me know.

If, you dont get my point, please let me know.

Thanks
 
Old 05-15-2013, 07:38 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
You don't use the example literally, you replace it with your reqd string.
If its only for your user and you know how to edit, you may be better doing it that way.

You should bookmark/read
http://rute.2038bug.com/index.html.gz
 
Old 05-15-2013, 07:56 AM   #3
projjwal
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your reply and suggestion. Is there any way to revert back to previous state?, I have only fired that command, as i mentioned? Any hint, where to change? Because, i can to fire any command right now, as every command fire shows the error, as i mentioned. Iam stuck.

Thanks
 
Old 05-15-2013, 08:00 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,208

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
log in as another user, then 'su' to root without the environment. change the file to suit your needs.

or

reboot, log into single user mode, edit the file and change it to suit your needs.
 
Old 05-15-2013, 08:09 AM   #5
projjwal
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, i will try accordingly and will let you know the result.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No symbol table is loaded. Use the "file" command. when setting breakpoints hjc Linux - Newbie 3 02-02-2016 03:03 AM
How to "export" out put of command "date"? hbchok Linux - Newbie 6 11-03-2012 04:14 AM
.bash_profile, "-bash: export: command not found" Squall90 Slackware 9 05-16-2012 03:45 PM
Running "script" command from .bashrc/.cshrc zeke666 Linux - General 17 04-16-2012 09:11 PM
$ gedit.bashrc &-"COMMAND NOT FOUND" aabhardadhich Linux - Software 4 03-01-2007 05:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration