[opensuse] retaining bash history across reboot
I have five local boxes containing the same .bashrc localized for it's box. On two root's history is not retained across boots, but all users' and the other three roots are. All boxes/users are using bash as $SHELL from .bashrc shopt -s histappend export HISTCONTROL=ignoredups:erasedups export PROMPT_COMMAND='history -s' Why is history removed for the two boxes or how can I determine that. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 30 Mar 2015 21:04, Patrick Shanahan <paka@...> wrote:
I have five local boxes containing the same .bashrc localized for it's box. On two root's history is not retained across boots, but all users' and the other three roots are.
All boxes/users are using bash as $SHELL
from .bashrc shopt -s histappend export HISTCONTROL=ignoredups:erasedups export PROMPT_COMMAND='history -s'
Why is history removed for the two boxes or how can I determine that.
First, check if even a ~/.bash_history file is written at all. For that, $HISTFILE must be set to a valid file, and $HISTFILESIZE must be greater than zero. Further, 'history -s' is not what you want, try 'history -a' in the PROMPT_COMMAND "echo $HIST<TAB><TAB>" should at least show: $HISTCMD $HISTFILE $HISTSIZE $HISTCONTROL $HISTFILESIZE Addenum: The moment you use "unset HISTFILE" the "magic" is gone and can not be restored for this shell. Have a look at the other 'startup' files (if they exist) and how they differ between the boxes: ~/.profile ~/.bash_profile ~/.login Have look, and if further question come up, give a message. - Yamaban -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Yamaban <foerster@lisas.de> [03-30-15 15:18]:
On Mon, 30 Mar 2015 21:04, Patrick Shanahan <paka@...> wrote:
I have five local boxes containing the same .bashrc localized for it's box. On two root's history is not retained across boots, but all users' and the other three roots are.
All boxes/users are using bash as $SHELL
from .bashrc shopt -s histappend export HISTCONTROL=ignoredups:erasedups export PROMPT_COMMAND='history -s'
Why is history removed for the two boxes or how can I determine that.
First, check if even a ~/.bash_history file is written at all.
For that, $HISTFILE must be set to a valid file, and $HISTFILESIZE must be greater than zero.
It is.
Further, 'history -s' is not what you want, try 'history -a' in the PROMPT_COMMAND
Will adjust for this, but have no had any problem with other boxes/user with "history -s" :^)
"echo $HIST<TAB><TAB>" should at least show: $HISTCMD $HISTFILE $HISTSIZE $HISTCONTROL $HISTFILESIZE
All present
Addenum: The moment you use "unset HISTFILE" the "magic" is gone and can not be restored for this shell.
Have not.
Have a look at the other 'startup' files (if they exist) and how they differ between the boxes: ~/.profile ~/.bash_profile ~/.login
None of these exist for the two root accts. tks, -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Patrick Shanahan
-
Yamaban