You are not logged in.

#1 2013-03-05 06:33:21

Torxed
Member
Registered: 2013-01-10
Posts: 202

[SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

Hi.

Sorry for being a completely daft new user to archlinux with my simple questions..
But here goes nothing!

Why doesn't my ~/.bashrc work? It's like it's not even used.
It looks like this:

[root@openvpnserver ~]# cat ~/.bashrc
export VISUAL=nano
export EDITOR=nano

Cheers in advance!

Last edited by Torxed (2013-03-05 07:19:41)

Offline

#2 2013-03-05 06:34:44

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

Because you are logged in as root?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-03-05 06:46:25

Torxed
Member
Registered: 2013-01-10
Posts: 202

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

jasonwryan wrote:

Because you are logged in as root?

And i still want a bashrc for my root session?

 GNU nano 2.2.6             File: /root/.bashrc

Offline

#4 2013-03-05 06:52:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

If you are logged in as root, your .bashrc should be in /root/ (or a symlink to ~/.bashrc)...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-03-05 07:06:56

Torxed
Member
Registered: 2013-01-10
Posts: 202

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

As i posted, it is in root (i don't want to be rude but read my last post)...


File: /root/.bashrc

Last edited by Torxed (2013-03-05 07:07:06)

Offline

#6 2013-03-05 07:16:41

Torxed
Member
Registered: 2013-01-10
Posts: 202

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

Coolios, this was the missing piece in the puzzle.
Per default, the skel files are not copied to the root dir (for good reasons IMO), so the .bash_profile file was missing which, is the file that launches the .bashrc.

Dunno why i don't just put the bashrc content right into the bash_profile file tho? i really hate nested files that doesn't have any real meaning or thought behind it on "simple" systems as mine.
Sleek, fast and neat is way better then trying to follow a flow of files nested in a chain of executions.

[root@openvpnserver]# cat ~/.bash_profile
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

Last edited by Torxed (2013-03-05 07:19:19)

Offline

#7 2013-03-05 07:32:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

FWIW, I read your post, but

And i still want a bashrc for my root session?
GNU nano 2.2.6             File: /root/.bashrc

Is a question and doesn't actually tell me much; and seeing my mind reading skills are fading at a faster rate than my memory...

If you are going to export environment variables, you should put them in your .profile or .bash_profile.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2013-03-05 09:33:50

Torxed
Member
Registered: 2013-01-10
Posts: 202

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

jasonwryan wrote:

FWIW, I read your post, but

And i still want a bashrc for my root session?
GNU nano 2.2.6             File: /root/.bashrc

Is a question and doesn't actually tell me much; and seeing my mind reading skills are fading at a faster rate than my memory...

If you are going to export environment variables, you should put them in your .profile or .bash_profile.

Didn't mean to sound condescending, my apologizes!
The code-block was a copy-paste from the nano session in which the content of .bashrc was first given in the first post, might be a bit unclear for normal geeks using vi or emacs :P

Thank you for the tip, moved the exports to the .bash_profile!

Offline

#9 2013-03-05 12:21:31

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: [SOLVED] .bashrc doesn't load? -> Missing ~/.bash_profile

Torxed wrote:

Coolios, this was the missing piece in the puzzle.
Per default, the skel files are not copied to the root dir (for good reasons IMO), so the .bash_profile file was missing which, is the file that launches the .bashrc.

Dunno why i don't just put the bashrc content right into the bash_profile file tho? i really hate nested files that doesn't have any real meaning or thought behind it on "simple" systems as mine.
Sleek, fast and neat is way better then trying to follow a flow of files nested in a chain of executions.

[root@openvpnserver]# cat ~/.bash_profile
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

Well, ~/.bash_profile is read when you log in. If you launch X and then open a terminal, you're already logged in, so ~/.bashrc is read instead. Mostly, these days, most folk'll jump straight into X and stay there. Anyway, there are some things best put into ~/.bash_profile before you source ~/.bashrc, so that they don't get "read in" every time you open a terminal (modifying $PATH comes to mind).

EDIT: and as jasonwryan says: your other environment variables as well.

Last edited by Antoine (2013-03-05 12:28:10)

Offline

Board footer

Powered by FluxBB