LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   not able to call .bashrc in my home login (https://www.linuxquestions.org/questions/linux-newbie-8/not-able-to-call-bashrc-in-my-home-login-937815/)

wagmare 04-03-2012 12:22 AM

not able to call .bashrc in my home login
 
hi friends,

A week before i tried to change the terminal text PS1 value in .bashrc of my home directory ...as a result my bash login is not exporting any of my PATH, LD_LIBRARY_PATH, INCLUDE_PATH .. whatever i was having in /etc/bashrc is not exported to my login terminal ....

i removed the PS1 entry ...


if i use the command $bash it is working fine ..
but every time i need to type the 'bash' command whenever i open a new terminal ...
whatever i include in .bashrc or .bash_profile also not exported when i select a new terminal ...


Please help ..
Thanks in advance ...

Slackyman 04-03-2012 12:30 AM

Which distro are you using?

catkin 04-03-2012 01:56 AM

There is a difference between the startup files that bash runs at logon and when starting an interactive shell after logging on (the last happens most commonly when starting a terminal emulator in a graphical desktop environment). Commonly the logon files are modified to also run the "interactive non-login shell" files to make the environment the same in each case.

You could add the following at the end of /etc/profile
Code:

case $- in
    *i* )  # We're interactive
        if [ -f /etc/bashrc ]; then . /etc/bashrc; fi
        if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
esac


wagmare 04-03-2012 03:17 AM

Quote:

Originally Posted by Slackyman (Post 4643254)
Which distro are you using?

i dont know about distro ...?

bigrigdriver 04-03-2012 03:56 AM

Linux distribution = distro

Which Linux distribution (distro) and version number are you using?

Examples:
Debian 6.0
Opensuse 12.1
Ubuntu 12.04
and others.

pan64 04-03-2012 05:56 AM

What is your default shell? Just open a terminal and enter echo $0

Slackyman 04-03-2012 10:46 AM

I think that is bash since it's tthe most used one in the most used distros.
I think also that the catkin solution is the best one can do in this case.

wagmare 04-09-2012 04:42 AM

first thanks for reply u all ..

Quote:

Originally Posted by Slackyman (Post 4643741)
I think that is bash since it's tthe most used one in the most used distros.
I think also that the catkin solution is the best one can do in this case.

my shell is bash only ...rhel 6 kernel version 2.3.32-71 ..


catkin i will try now ...

wagmare 04-09-2012 04:43 AM

Quote:

Originally Posted by catkin (Post 4643297)
There is a difference between the startup files that bash runs at logon and when starting an interactive shell after logging on (the last happens most commonly when starting a terminal emulator in a graphical desktop environment). Commonly the logon files are modified to also run the "interactive non-login shell" files to make the environment the same in each case.

You could add the following at the end of /etc/profile
Code:

case $- in
    *i* )  # We're interactive
        if [ -f /etc/bashrc ]; then . /etc/bashrc; fi
        if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
esac



i tried this but it still failing to call the bashrc automatically ... if i call the bash command manually on my shell its working .. but every time i cant do that when ever i open a new terminal ..

pan64 04-10-2012 01:24 AM

just write an "echo this is /etc/bashrc" into /etc/bashrc (and something similar to ~/.bashrc to see if they were invoked.
How do you know they are not executed?


All times are GMT -5. The time now is 12:24 PM.