[arch-general] /etc/bash.bashrc not sourcing/setting HISTXXX environment
All, I generally create a system-wide /etc/bash.bashrc.local file to contain history defaults. E.g.: $ cat /etc/bash.bashrc.local HISTCONTROL=ignoreboth:erasedups HISTIGNORE='[ ]*:&:?' (HISTSIZE & HISTFILESIZE are exported on a per-user basis in ~/.bashrc) I then just add a line to source it in /etc/bash.bashrc: $ cat /etc/bash.bashrc # # /etc/bash.bashrc # <snip> # - source /etc/bash.bashrc.local [ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local Both files are present and readable: $ ls -l /etc/bash.bashrc* -rw-r--r-- 1 root root 697 Apr 6 20:01 /etc/bash.bashrc -rw-r--r-- 1 root root 418 Mar 10 09:40 /etc/bash.bashrc.local I do this the same way on both Arch and SuSE. Chasing a bash bug on SuSE, I would check the the environment with: $ env | grep HIST HISTSIZE=20000 HISTFILESIZE=20000 HISTIGNORE= *:&:?:?? HISTCONTROL=ignoreboth:erasedups Doing a pacman update earlier to day, I just checked the environment on Arch on a whim: $ env | grep HIST HISTSIZE=5000 HISTFILESIZE=15000 Huh? Where is HISTIGNORE and HISTCONTROL? Is there something unique to Arch that prevents sourcing or prevents setting HISTXXX in this manner. I can't think of anything offhand that would prevent it, but it certainly isn't being set. Any ideas on why? -- David C. Rankin, J.D.,P.E.
On 07-04-15 03:41, David C. Rankin wrote:
All,
I generally create a system-wide /etc/bash.bashrc.local file to contain history defaults. E.g.:
$ cat /etc/bash.bashrc.local HISTCONTROL=ignoreboth:erasedups HISTIGNORE='[ ]*:&:?'
(HISTSIZE & HISTFILESIZE are exported on a per-user basis in ~/.bashrc) I then just add a line to source it in /etc/bash.bashrc:
$ cat /etc/bash.bashrc # # /etc/bash.bashrc # <snip> # - source /etc/bash.bashrc.local [ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local
Both files are present and readable:
$ ls -l /etc/bash.bashrc* -rw-r--r-- 1 root root 697 Apr 6 20:01 /etc/bash.bashrc -rw-r--r-- 1 root root 418 Mar 10 09:40 /etc/bash.bashrc.local
I do this the same way on both Arch and SuSE. Chasing a bash bug on SuSE, I would check the the environment with:
$ env | grep HIST HISTSIZE=20000 HISTFILESIZE=20000 HISTIGNORE= *:&:?:?? HISTCONTROL=ignoreboth:erasedups
Doing a pacman update earlier to day, I just checked the environment on Arch on a whim:
$ env | grep HIST HISTSIZE=5000 HISTFILESIZE=15000
Huh? Where is HISTIGNORE and HISTCONTROL? Is there something unique to Arch that prevents sourcing or prevents setting HISTXXX in this manner. I can't think of anything offhand that would prevent it, but it certainly isn't being set. Any ideas on why?
/etc/bash.bashrc is sourced from /etc/profile . from man bash : Konsole output When bashis invoked as an interactive login shell, or as a non-interactive shell with the --loginoption, it first reads and executes commands from the file /etc/profile, if that file exists. Verfiy your /etc/profile and are you sure you are running the command from an interactive login shell ? LVV
On Tue, Apr 7, 2015 at 2:20 PM, LoneVVolf <lonewolf@xs4all.nl> wrote:
On 07-04-15 03:41, David C. Rankin wrote:
I generally create a system-wide /etc/bash.bashrc.local file to contain history defaults. E.g.:
Verfiy your /etc/profile and are you sure you are running the command from an interactive login shell ?
See also https://wiki.archlinux.org/index.php/Bash#Configuration_files
On 04/07/2015 01:10 PM, Karol Blazewicz wrote:
On Tue, Apr 7, 2015 at 2:20 PM, LoneVVolf <lonewolf@xs4all.nl> wrote:
On 07-04-15 03:41, David C. Rankin wrote:
I generally create a system-wide /etc/bash.bashrc.local file to contain history defaults. E.g.:
Verfiy your /etc/profile and are you sure you are running the command from an interactive login shell ?
See also https://wiki.archlinux.org/index.php/Bash#Configuration_files
Now I'm confused. All the shells launched are logon shells as they are what occurs after I ssh into the box. According to the link above concerning /etc/profile: <quote> An interactive shell that is also a login shell (for example, from /usr/bin/login). Sources application settings in /etc/profile.d/*.sh, and /etc/bash.bashrc. </quote> /etc/profile does indeed source /etc/bash.bashrc # Source global bash config if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then . /etc/bash.bashrc fi Now the test test "$PS1" && test "$BASH" is doing what? Limiting it to an interactive non-logon invocation? -- David C. Rankin, J.D.,P.E.
participants (3)
-
David C. Rankin
-
Karol Blazewicz
-
LoneVVolf