Hello all,
I've got a problem with running the "history" command in a sourced (preloaded) function:
- - - - - - - - - - histtest() { history -c history -s "foobar" } histtest
- - - - - - - - - -
When I source this script the history gets cleared and the "foobar" entry is added to it. IOW, it works as expected.
However, when I than afterwards just type "histtest" on the commandline the history is cleared, but the "foobar" entry isn't added.
Question: what causes the difference and how do I fix it ?
Remark: the trouble seems to come from clearing the history. When I remove that line the "foobar" entry is, in both cases, added as expected.
Regards, Rudy Wieser