Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-11-2003, 06:41 PM
|
#1
|
Member
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332
Rep:
|
Is there a way to make .bashrc effect console mode?
Hi. I work outside of X for C programming in VIM and noticed that
my aliases that are set in .bashrc don't work unless I start X and work at an XTERM. Is there a way, or another file to alter that will effect alias at just the good ol' console other than altering /etc/profile?
thnks 
|
|
|
03-11-2003, 06:44 PM
|
#2
|
Member
Registered: Feb 2003
Distribution: Debian
Posts: 797
Rep:
|
when logged in, try running 'bash'
see if your aliases work after that...
|
|
|
03-11-2003, 06:58 PM
|
#3
|
Member
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332
Original Poster
Rep:
|
that did the trick! But is this the normal way to do it? Or is there a file I can alter?
And Im curious .... When I ran 'bash' what exactly did I do, or what did this
command effect?
thanks alot 
Last edited by purpleburple; 03-11-2003 at 06:59 PM.
|
|
|
03-11-2003, 07:20 PM
|
#4
|
Member
Registered: Feb 2003
Distribution: Debian
Posts: 797
Rep:
|
see 'man bash' (especially the Invocation section)
^the rest may also be a good read, but it would be a good, long read.
; )
Easiest explanation I can think of is that console would be considered a login shell, while in X any terms that are started are children of the parent shell (ie. not login = .bashrc parsed)
As for why 'bash' works, I guess it "re-parses" (?) all files :: all I know is that you can use 'bash' to parse your files so you can change your aliases on the fly.
: )
^ hopefully someone can give a better explanation
|
|
|
03-11-2003, 07:22 PM
|
#5
|
Member
Registered: Feb 2003
Distribution: Debian
Posts: 797
Rep:
|
Quote:
while in X any terms that are started are children of the parent shell
|
this is supported by looking at 'pstree'
do you know how the .xsession/.xinitrc works?
well, this is the same idea: only this time even X is a child of the 'bash' process (which is started by init)
|
|
|
03-11-2003, 07:31 PM
|
#6
|
Senior Member
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918
Rep: 
|
Quote:
noticed that my aliases that are set in .bashrc don't work unless I start X and work at an XTERM.
|
That's odd. To simplify commands for people working on some VT terminals, .bashrc is exactly where I put the alias'. I am not sure if I tried them on a PC console.
|
|
|
03-11-2003, 07:38 PM
|
#7
|
Member
Registered: Feb 2003
Distribution: Debian
Posts: 797
Rep:
|
BTW, one solution could be to create (or add to) a ~/.bash_profile:
Code:
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
or something like that.
; )
|
|
|
All times are GMT -5. The time now is 03:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|