Hi,
it seems to be inordinately difficult to persuade the history (or fc) commands to list only the commands evaluated in the current session (ie, the contents of the in-memory history buffer).
something like:
gets some way there, but it also requires manually appending history to .bash_history, since the manual append seems to disable the append on exit. So, maybe...
But this means the in memory history is appended to $HISTFILE whenever the command is used, so the commands are appended multiple times.
To sum up, listing the history of the current session seems like something a user might want to do. A search online reveals plenty of advice about executing the second to last command starting with 'cc' (something I can't imagine myself ever wanting to do) but absolutely nothing to answer this question.
Am I missing something?
Cheers,
bitrat
it seems to be inordinately difficult to persuade the history (or fc) commands to list only the commands evaluated in the current session (ie, the contents of the in-memory history buffer).
something like:
Code:
echo '' >| junk ; history -a junk ; cat junk
Code:
echo '' >| junk ; history -a junk ; cat junk ; history -a
To sum up, listing the history of the current session seems like something a user might want to do. A search online reveals plenty of advice about executing the second to last command starting with 'cc' (something I can't imagine myself ever wanting to do) but absolutely nothing to answer this question.
Am I missing something?
Cheers,
bitrat
Statistics: Posted by bitrat — 2024-07-02 23:28 — Replies 0 — Views 29