LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-03-2012, 12:22 AM   #1
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Rep: Reputation: 15
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 ...
 
Old 04-03-2012, 12:30 AM   #2
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Which distro are you using?
 
Old 04-03-2012, 01:56 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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
 
1 members found this post helpful.
Old 04-03-2012, 03:17 AM   #4
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Slackyman View Post
Which distro are you using?
i dont know about distro ...?
 
Old 04-03-2012, 03:56 AM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
Old 04-03-2012, 05:56 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
What is your default shell? Just open a terminal and enter echo $0
 
Old 04-03-2012, 10:46 AM   #7
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
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.
 
Old 04-09-2012, 04:42 AM   #8
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Original Poster
Rep: Reputation: 15
first thanks for reply u all ..

Quote:
Originally Posted by Slackyman View Post
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 ...

Last edited by wagmare; 04-09-2012 at 04:44 AM.
 
Old 04-09-2012, 04:43 AM   #9
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by catkin View Post
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 ..
 
Old 04-10-2012, 01:24 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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?
 
  


Reply



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
setting multiple java home variables in linux/.bashrc kaloon88 Linux - Newbie 3 11-30-2011 06:43 AM
How do I use bashrc to redirect an executable call? georgejc Programming 2 05-26-2011 10:03 PM
'bashrc user login karanjeet Linux - Desktop 1 07-18-2008 10:34 AM
create a variable in the .bashrc file in my home directory coldbeerz Linux - Newbie 2 12-14-2007 09:48 AM
.login, .bashrc or .cshrc ??? tuananhbirm Linux - General 1 01-20-2005 09:44 AM

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

All times are GMT -5. The time now is 10:23 AM.

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
Open Source Consulting | Domain Registration