LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 03-11-2003, 06:41 PM   #1
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Rep: Reputation: 30
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
 
Old 03-11-2003, 06:44 PM   #2
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
when logged in, try running 'bash'

see if your aliases work after that...
 
Old 03-11-2003, 06:58 PM   #3
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Original Poster
Rep: Reputation: 30
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.
 
Old 03-11-2003, 07:20 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
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
 
Old 03-11-2003, 07:22 PM   #5
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
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)
 
Old 03-11-2003, 07:31 PM   #6
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
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.
 
Old 03-11-2003, 07:38 PM   #7
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
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.
; )
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
.bashrc and console colours edM Slackware 3 11-01-2005 02:52 PM
How to make the new IP to take effect without rebooting the system Bassam Linux - Networking 2 03-09-2005 01:58 AM
How to make the QtCurve theme effect on apps of gtk-2 in suse-9.2? tony yu SUSE / openSUSE 0 02-10-2005 06:04 AM
Gimp-how to make an effect Boby Linux - Software 2 11-29-2004 01:52 PM
Mandrake 9.2's boot process entirely done in console mode before loading in X mode... mishmash Mandriva 6 02-17-2004 09:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:07 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