The question is simply this: how is the PAGER variable set by default for all users in Ubuntu Linux? Where is this done (in terms of a standard file or location)?
A secondary question is how might this get unset?
I have been told to use /etc/profile
and/or /etc/environment
to fix it, and I am experimenting with these as solutions, but neither of these was used to set the PAGER variable originally. Where should this have been done?
Here is the problem that led me to this question:
man
stopped working on my Ubuntu (18.04) system a while ago. I did not notice that it had failed at first until git log
also failed and I saw this answer on fixing that. When I use the command export PAGER=more
it fixes the problem with both man
and git
.
To fix the problem for me, I have added the line:
export PAGER=more
to my .bashrc
file. It took some looking around to realize the difference between that command and just PAGER=more
, but this answer spelled it out for me. I guess my calls to man
and git
are subprocesses, and adding the export
in front is needed for them to have access to the variable. (If that is wrong, please inform me!)