You are not logged in.

#1 2010-07-23 17:37:13

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

[SOLVED] ~/.bash_login not working

Hi all.

I'm trying to run some bash commands at login but I can't seem to get it to work. I've put the commands in the ~/.bash_login file but it doesn't seem to run.  I've tried it with just a simple command ("mkdir ~/test") to make sure it isn't an error in the code. ~/.bash_logout seems to work ok though.

What am I doing wrong?

Last edited by Chris Denton (2010-07-24 11:53:56)

Offline

#2 2010-07-23 17:57:01

bearman51
Member
Registered: 2010-04-18
Posts: 14

Re: [SOLVED] ~/.bash_login not working

Check if you also have a ~/.bash_profile file. If you do it is reading that first and only. Try putting your commands in that file or deleting it so it will read the .bash_login. It only reads one of ~/.bash_profile, ~/.bash_login, ~/.profile and looks for them in that order.

Offline

#3 2010-07-23 18:19:35

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] ~/.bash_login not working

the most common practice i've seen around here is a simple ~/.bash_profile which only serves to source ~/.bashrc; all settings/actions are then placed in ~/bashrc.

Offline

#4 2010-07-23 18:25:22

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

Re: [SOLVED] ~/.bash_login not working

Ahh, thanks! That worked smile

Offline

#5 2010-07-23 18:34:16

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

Re: [SOLVED] ~/.bash_login not working

Erm, actually, its not doing quite what I thought it would. It runs every time I start a new terminal in xfce. How do I just run something once when I login?

Offline

#6 2010-07-23 18:39:41

bearman51
Member
Registered: 2010-04-18
Posts: 14

Re: [SOLVED] ~/.bash_login not working

It is my understanding that ~/.bash_profile is sourced only when a new login shell is started not a new terminal. Everything in ~/.bashrc will be sourced every time a new terminal is started.

Offline

#7 2010-07-23 18:46:38

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

Re: [SOLVED] ~/.bash_login not working

Oh, that's what I was doing wrong. Thanks again.

Offline

#8 2010-07-24 09:33:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] ~/.bash_login not working

@ Chris Denton
Welcome to Arch. Glad you got your problem solved.
Please remember to mark topic as [solved].

Offline

#9 2010-07-24 09:54:19

Chris Denton
Member
Registered: 2010-07-23
Posts: 21

Re: [SOLVED] ~/.bash_login not working

Done big_smile

Offline

Board footer

Powered by FluxBB