This question already has an answer here:
- How to clear bash history completely? 8 answers
I am writing an script to dump my history log into another file "myhistory.log", and then clear that history. I have written the following set of commands:
date >> myhistory.log history >> myhistory.log history -c
Everything goes well except that the previous history is not cleared. I have tried the following variations:
CLRH="history -c" exec $CLRH
What I am missing probably??