Writes bash history after each command