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:
\history -c
and
CLRH="history -c"
exec $CLRH
What I am missing probably??
history
builtin acts differently in scripts? Please [edit] your question and clarify. – terdon Mar 27 '14 at 15:34