I’ve set some different options to securing the history file in comparison with the original document.
data=`date +%EY%m%d_%H%M%S`
control=`who -m |tr -s ‘_’ ‘!’ |tr -s ‘ ‘ ‘_’|tr -s ‘ ‘ ‘_’|tr -s ‘(‘ ‘_’ |tr -s ‘)’ ‘_’ |cut -d ‘_’ -f 1,6 | tr -s ‘!’ ‘_’`
HISTFILE=/var/tmp/history/sh_history_$control.$data
HISTSIZE=100000000000000000
HISTFILESIZE=10000000000000000
readonly HISTFILE
readonly HISTSIZE
readonly HISTFILESIZE
export HISTFILE HISTSIZE HISTFILESIZE
Hope this can help!