Bash Configuration Files: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 11: Line 11:
This article describes how bash executes its startup files. If any of the files exist, but cannot be read, bash reports an error.
This article describes how bash executes its startup files. If any of the files exist, but cannot be read, bash reports an error.
=Interactive Login Shell=
=Interactive Login Shell=
This sequence is executed by an interactive login shell, or a shell that was invoked with <code>--login</code>:
<font size=-1>
<font size=-1>
  ├─→ [[/etc/profile]] ─→ /etc/profile.d/*.sh
  ├─→ [[/etc/profile]] ─→ /etc/profile.d/*.sh

Revision as of 03:59, 22 November 2021

External

Internal

Overview

This article describes how bash executes its startup files. If any of the files exist, but cannot be read, bash reports an error.

Interactive Login Shell

This sequence is executed by an interactive login shell, or a shell that was invoked with --login:

├─→ /etc/profile ─→ /etc/profile.d/*.sh
│
│
└─→ ~/.bash_profile ─→ ~/.bash_login ─→ ~/.profile

Interactive Non-Login Shell

Non-Interactive Shell

Invoked with the name "sh"

Invoked by Remote Shell Daemon

Invoked with Unequal Effective and Real UID/GIDs