by dale-cooper · 11y ago · 0 comments
I guess you'd have to set the history-size etc large enough to hopefully last for the maximum expected shell run-time.
EDIT: hmm, the man page says you can just unset HISTFILESIZE or set it to a non-numeric/negative value to avoid truncating the history file at all.
export HISTSIZE=65535 # why not?
export HISTFILESIZE=65535
export HISTCONTROL=ignoredups
but now I'm wondering if I should unset `HISTFILESIZE` insteead.If you're planning on keeping a lot of history, ignorespace makes it easy to avoid inserting commands with sensitive info. A well-placed $(cat) can work too.
$ PASSWORD=hunter2 # sensitive info doesn't go into history
$ curl -O http://name:$PASSWORD@server/path # command with correct syntax does go into history cat `find "${HOME}/.history" -type f | grep -v ".allhistory"` > ${HOME}/.history/.allhistory
history -r ${HOME}/.history/.allhistory