Skip to main content
added 4 characters in body
Source Link
techraf
  • 4.3k
  • 10
  • 32
  • 43

Upon login, bash does not automatically execute my ~/.bashrc script. Every other Linux distro I've run does this automatically, so I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for the login shell. And it's the same for any bash instance, regardless of the "Linux distro".


Is there another file that bash runs on startup?

Per man bash:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.


what's the syntax?

Either of the files mentioned above is a bash script file. No special syntax is required.

Upon login, bash does not automatically execute my ~/.bashrc script. Every other Linux distro I've run does this automatically, so I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for login shell. And it's the same for any bash instance, regardless of the "Linux distro".


Is there another file that bash runs on startup?

Per man bash:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.


what's the syntax?

Either of the files mentioned above is a bash script file. No special syntax is required.

Upon login, bash does not automatically execute my ~/.bashrc script. Every other Linux distro I've run does this automatically, so I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for the login shell. And it's the same for any bash instance, regardless of the "Linux distro".


Is there another file that bash runs on startup?

Per man bash:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.


what's the syntax?

Either of the files mentioned above is a bash script file. No special syntax is required.

added 133 characters in body
Source Link
techraf
  • 4.3k
  • 10
  • 32
  • 43

Upon login, bash does not automatically execute my ~/.bashrc script. [ ]Every other Linux distro I've run does this automatically, so I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for login shell. And it's the same for any bash instance, regardless of the "Linux distro".

 

Is there another file that bash runs on startup?

Per man bash:

~/.bash_profile
       The personal initialization file, executed for login shells

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.


what's the syntax?

It'sEither of the files mentioned above is a bash script file. No special syntax is required.

Upon login, bash does not automatically execute my ~/.bashrc script. [ ] I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for login shell.

Is there another file that bash runs on startup?

Per man bash:

~/.bash_profile
       The personal initialization file, executed for login shells

what's the syntax?

It's a bash script file. No special syntax is required.

Upon login, bash does not automatically execute my ~/.bashrc script. Every other Linux distro I've run does this automatically, so I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for login shell. And it's the same for any bash instance, regardless of the "Linux distro".

 

Is there another file that bash runs on startup?

Per man bash:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.


what's the syntax?

Either of the files mentioned above is a bash script file. No special syntax is required.

Source Link
techraf
  • 4.3k
  • 10
  • 32
  • 43

Upon login, bash does not automatically execute my ~/.bashrc script. [ ] I'm at loss to why Raspbian doesn't.

The first line of the default .bashrc should give you the answer:

# ~/.bashrc: executed by bash(1) for non-login shells.

It's for non-login shells, you are expecting it to be loaded for login shell.

Is there another file that bash runs on startup?

Per man bash:

~/.bash_profile
       The personal initialization file, executed for login shells

what's the syntax?

It's a bash script file. No special syntax is required.