Re: [gentoo-user] bashrc in console

2017-03-22 Thread Hogren


On 22/03/2017 14:57, Alan McKinnon wrote:
> On 22/03/2017 14:34, Hogren wrote:
>> Hello,
>>
>> Anybody knows why ~/.bashrc is not running on the first Bash opening ?
>>
>>
>> Steps to reproduce my problem:
>>
>> - I boot up my machine (systemd)
>>
>> - I have the login prompt
>>
>> - I enter my login, then my password
>>
>> - I am in Bash but ~/.bashrc is not sourced. Aliases, $PATH, and other
>> are not updated.
>>
>> - I enter the command "bash" to enter in a subshell. Now I have my new
>> aliases, $PATH, etc. The ~/.bashrc is sourced.
>>
>>
>>
>> I didn't find the good conf file.
>
> man bash, section INVOCATION.
>
> Study it and study it well. bash does not do with it's startup files
> what you probably assume it does.
>
> Read it, read it again, read it three times. Read and understand what
> is actually there.
>
>
I already read the man pages in the past, and even the Advanced Bash
Scripting Guide (very good free book). I just not remembered a thing
like that.

I didn't read it a second, and a third time ^^. That was my error :)

Bye

Hogren



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Alan McKinnon

On 22/03/2017 14:34, Hogren wrote:

Hello,

Anybody knows why ~/.bashrc is not running on the first Bash opening ?


Steps to reproduce my problem:

- I boot up my machine (systemd)

- I have the login prompt

- I enter my login, then my password

- I am in Bash but ~/.bashrc is not sourced. Aliases, $PATH, and other
are not updated.

- I enter the command "bash" to enter in a subshell. Now I have my new
aliases, $PATH, etc. The ~/.bashrc is sourced.



I didn't find the good conf file.


man bash, section INVOCATION.

Study it and study it well. bash does not do with it's startup files 
what you probably assume it does.


Read it, read it again, read it three times. Read and understand what is 
actually there.



--
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] bashrc in console

2017-03-22 Thread Hogren

> http://tinyurl.com/9hrrh53
Very good link. Interesting.
Thanks !

And thanks all for your answers.

Hogren



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Neil Bothwick
On Wed, 22 Mar 2017 13:34:50 +0100, Hogren wrote:

> Anybody knows why ~/.bashrc is not running on the first Bash opening ?
> 
> 
> Steps to reproduce my problem:
> 
> - I boot up my machine (systemd)
> 
> - I have the login prompt
> 
> - I enter my login, then my password
> 
> - I am in Bash but ~/.bashrc is not sourced. Aliases, $PATH, and other
> are not updated.
> 
> - I enter the command "bash" to enter in a subshell. Now I have my new
> aliases, $PATH, etc. The ~/.bashrc is sourced.

From the man page:
When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists.


-- 
Neil Bothwick

Newspaper Ad: Dog for sale: eats anything and is fond of children.


pgpyYCJNnhH4a.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] bashrc in console

2017-03-22 Thread Tom H
On Wed, Mar 22, 2017 at 9:02 AM, Hogren  wrote:
> On 22/03/2017 13:58, Hogren wrote:
>> On 22/03/2017 13:57, Hogren wrote:
>>> On 22/03/2017 13:42, Arthur Țițeică wrote:
 În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:
>
> Anybody knows why ~/.bashrc is not running on the first Bash
> opening ?

 Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an
 example.
>>>
>>> I don't understand. What do I have to in ~/.bash_profile to run
>>> .bashrc, even at the first logon ?
>>>
>>> I have nothing in /etc/skel.
>>>
>>> /etc/skel $ ls -l
>>> total 0
>>
>> Stupid Hogren… ls -a …
>
> Ok it works, thanks !
>
> Can you explain to me why the ~/.bashrc is sourced in subshells without
> .bash_profile ?

Because when you login, you're in a login shell (PS1 prepended with
"-") so ".bashrc" is sourced from ".bash_profile", ".bash_login", or
".profile" if you have one of them.

Whereas the subshell is an interactive, non-login shell, so ".bashrc"
is sourced directly.



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Andrew Lowe

On 22/03/17 21:02, Hogren wrote:



On 22/03/2017 13:58, Hogren wrote:


On 22/03/2017 13:57, Hogren wrote:

On 22/03/2017 13:42, Arthur Țițeică wrote:

În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:

Hello,

Anybody knows why ~/.bashrc is not running on the first Bash opening ?

Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an example.

I don't understand. What do I have to in ~/.bash_profile to run .bashrc,
even at the first logon ?

I have nothing in /etc/skel.

/etc/skel $ ls -l
total 0


Hogren


Stupid Hogren… ls -a …

I will look.

Sorry.


Ok it works, thanks !

Can you explain to me why the ~/.bashrc is sourced in subshells without
.bash_profile ?

Thanks again !

Bye

Hogren



Hogren,
	I've been playing around with .bash* stuff a bit due to setting up a 
Win based Linux like development environment for Uni students and, if 
I've understood your question correctly, these links might help. They 
outline what file is called in what context.



http://tinyurl.com/9hrrh53

http://tinyurl.com/hqemqzk

Andrew




Re: [gentoo-user] bashrc in console

2017-03-22 Thread Hogren


On 22/03/2017 13:58, Hogren wrote:
>
> On 22/03/2017 13:57, Hogren wrote:
>> On 22/03/2017 13:42, Arthur Țițeică wrote:
>>> În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:
 Hello,

 Anybody knows why ~/.bashrc is not running on the first Bash opening ?
>>> Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an example.
>> I don't understand. What do I have to in ~/.bash_profile to run .bashrc,
>> even at the first logon ?
>>
>> I have nothing in /etc/skel.
>>
>> /etc/skel $ ls -l
>> total 0
>>
>>
>> Hogren
>>
> Stupid Hogren… ls -a …
>
> I will look.
>
> Sorry.
>
Ok it works, thanks !

Can you explain to me why the ~/.bashrc is sourced in subshells without
.bash_profile ?

Thanks again !

Bye

Hogren



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Hogren


On 22/03/2017 13:57, Hogren wrote:
>
> On 22/03/2017 13:42, Arthur Țițeică wrote:
>> În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:
>>> Hello,
>>>
>>> Anybody knows why ~/.bashrc is not running on the first Bash opening ?
>> Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an example.
> I don't understand. What do I have to in ~/.bash_profile to run .bashrc,
> even at the first logon ?
>
> I have nothing in /etc/skel.
>
> /etc/skel $ ls -l
> total 0
>
>
> Hogren
>
Stupid Hogren… ls -a …

I will look.

Sorry.



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Hogren


On 22/03/2017 13:42, Arthur Țițeică wrote:
> În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:
>> Hello,
>>
>> Anybody knows why ~/.bashrc is not running on the first Bash opening ?
> Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an example.
I don't understand. What do I have to in ~/.bash_profile to run .bashrc,
even at the first logon ?

I have nothing in /etc/skel.

/etc/skel $ ls -l
total 0


Hogren



Re: [gentoo-user] bashrc in console

2017-03-22 Thread Arthur Țițeică
În ziua de miercuri, 22 martie 2017, la 14:34:50 EET, Hogren a scris:
> Hello,
> 
> Anybody knows why ~/.bashrc is not running on the first Bash opening ?

Maybe you're missing '.bash_profile'. Look in /etc/skel/ for an example.

> 
> 
> Steps to reproduce my problem:
> 
> - I boot up my machine (systemd)
> 
> - I have the login prompt
> 
> - I enter my login, then my password
> 
> - I am in Bash but ~/.bashrc is not sourced. Aliases, $PATH, and other
> are not updated.
> 
> - I enter the command "bash" to enter in a subshell. Now I have my new
> aliases, $PATH, etc. The ~/.bashrc is sourced.
> 
> 
> 
> I didn't find the good conf file.
> 
> 
> Thank you for help !
> 
> 
> 
> Hogren





[gentoo-user] bashrc in console

2017-03-22 Thread Hogren
Hello,

Anybody knows why ~/.bashrc is not running on the first Bash opening ?


Steps to reproduce my problem:

- I boot up my machine (systemd)

- I have the login prompt

- I enter my login, then my password

- I am in Bash but ~/.bashrc is not sourced. Aliases, $PATH, and other
are not updated.

- I enter the command "bash" to enter in a subshell. Now I have my new
aliases, $PATH, etc. The ~/.bashrc is sourced.



I didn't find the good conf file.


Thank you for help !



Hogren