I am kinda wary of messing with bash history settings and I just want to write my own custom bash history. I thought about using a bash function like this:
bash(){
# write to a custom history file manually
echo "$@" >> $HOME/my_bash_history
command bash "$@"
}
export -f bash;
but this doesn't quite work - what happens is that the command bash
takes over, and things no longer go through the bash function. I need all stdin to bash to go through this bash function in order for everything to be written to a custom file. Anyone have an idea on how to do this?