Fedora Linux Support Community & Resources Center
  #1  
Old 3rd March 2009, 03:50 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
Why .bashrc doesn't work?

I have an account and its default shell is bash. I set some variable settings in ~/.bashrc. But after login, it doesn't load this file. Why .bashrc doesn't work?

thanks.
Reply With Quote
  #2  
Old 3rd March 2009, 04:31 AM
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 5,630
Try putting those in ~/.bash_profile instead. Normally that's the file that sources ~/.bashrc, though it doesn't have to. Also, if using a terminal window make sure it's using a login shell. For example: xterm -ls
Reply With Quote
  #3  
Old 4th March 2009, 05:21 AM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
the bashrc is for nonlogin purposes. The bash_profile is for login purposes.

If you want global environment variables for all users, then it need to be in a xxxxx.sh file in /etc/profile.d directory.

Example, I have an oracle.sh in /etc/profile.d directory.
Code:
[marc@kiriyamablevins ~]$ cat oracle.sh
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=kiriyamablevins.dyndns.org; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

[marc@kiriyamablevins ~]$
Reply With Quote
  #4  
Old 30th March 2009, 02:38 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
Does this method work across different shell? If I define a file, oracle.sh, then a user log-in as a c-shell user, will the environment available for him?
Reply With Quote
  #5  
Old 30th March 2009, 03:01 AM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
Quote:
Does this method work across different shell? If I define a file, oracle.sh, then a user log-in as a c-shell user, will the environment available for him?
Reply With Quote
Dont' think so.
Go ahead and use csh, then:
Code:
set | grep ORACLE
Does it show anything?
Reply With Quote
  #6  
Old 30th March 2009, 03:06 AM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Nanjing, China
Posts: 1,332
Quote:
Originally Posted by youhaodeyi View Post
Does this method work across different shell? If I define a file, oracle.sh, then a user log-in as a c-shell user, will the environment available for him?
Take a look at the contents of /etc/profile.d -- that will be enough to answer your question.
__________________
Code:
from rlyeh import cthulhu
cthulhu.fhtagn()
Reply With Quote
  #7  
Old 30th March 2009, 03:13 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
The file extension is .sh will be applied to bash while the .csh will apply to csh.
Reply With Quote
Reply

Tags
bashrc, work

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
.bash_profile, .bashrc ignored in f10... edszr Using Fedora 0 27th April 2009 12:04 AM
/home/.bashrc Stian1979 Using Fedora 1 16th May 2007 01:52 PM
/etc/bashrc sasdav Using Fedora 3 11th April 2006 02:18 PM
.bashrc not executing in TTY brownen Using Fedora 2 7th August 2005 04:32 PM
I messed up my /etc/bashrc. Javier Using Fedora 4 12th September 2004 05:27 PM


Current GMT-time: 11:22 (Monday, 01-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat