Move MANPAGER .profile to .bashrc #46

Closed
opened 2026-04-20 14:57:15 +02:00 by yestax · 1 comment
Owner

.profile (.bash_profile) is meant to be run once when logging in. To set up environment.
.bashrc is meant to be read at every new shell open.

When starting a non-login shell, MANPAGER isn't set and so can't be used.

.profile (.bash_profile) is meant to be run once when logging in. To set up environment. .bashrc is meant to be read at every new shell open. When starting a non-login shell, MANPAGER isn't set and so can't be used.
yestax added this to the Setup v1.3.X milestone 2026-04-30 18:53:28 +02:00
Author
Owner

The thing is:

2 cases:

Opening a terminal through ssh

start an interractive login shell: search for .bash_profile, .bash_login, .profile (in this order) other are ignored
Debian: only .profile and .bashrc -> .profile source .bashrc. File sourced .profile and .bashrc
Fedora: default .bash_profile and .bashrc -> .bash_profile source .bashrc. File sourced .bash_profile and .bashrc (no .profile)

Opening a terminal directly on computer

start an interactive non-login shell:
Subsequent open: start an interactive non-login shell: search for .bashrc
Debian: file sourced .bashrc
Fedora: file sourced .bashrc

So .profile is not sourced directly on computer.

.profile is meant for things that must be done only one time at login
.bashrc are things that must be enabled within the shell every-time.

MANPAGER falls in the latter category

The thing is: 2 cases: ## Opening a terminal through ssh start an interractive login shell: search for .bash_profile, .bash_login, .profile (in this order) other are ignored Debian: only .profile and .bashrc -> .profile source .bashrc. File sourced .profile and .bashrc Fedora: default .bash_profile and .bashrc -> .bash_profile source .bashrc. File sourced .bash_profile and .bashrc (no .profile) ## Opening a terminal directly on computer start an interactive non-login shell: Subsequent open: start an interactive non-login shell: search for .bashrc Debian: file sourced .bashrc Fedora: file sourced .bashrc So .profile is not sourced directly on computer. .profile is meant for things that must be done only one time at login .bashrc are things that must be enabled within the shell every-time. MANPAGER falls in the latter category
yestax changed title from Move MANPAGER .profile to .bashrc if possible to Move MANPAGER .profile to .bashrc 2026-05-28 17:08:44 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yestax/setup#46
No description provided.