Unique HISTFILEs for each ksh terminal open?
I'm running KDE and I'm using Konsole, which believe is a kshell. I usually have many terminals open at once and I'm trying to have my command line history be unique for each terminal open. I have tried adding this to my .profile:
unset HISTSIZE
unset HISTFILE
HISTSIZE=100;export HISTSIZE
HISTFILE=$HOME/.sh_history_$$;export HISTFILE
I tried using $PID and $PPID instead of $$ with no success. However, as you can probably guess, this is not working. It is creating a .sh_history for a PID but when I open a new Konsole tab it is still using the same history.
It seems I don't understand how PIDs work. When I do a "print $PPID" in the command line, the results are identical for all tabbed terminals, but they are different if I open a brand new Konsole by right clicking on the desktop. However, none of the PPIDs show up as a history file. I'm horribly confused.
Also, I realize that this could create many separate history files as time goes on; is there a way to delete a terminal's history file when closing it?
When I ran GNOME a while ago, command line histories were unique for each terminal and tab I had open. I don't know why it's different in KDE.
Thanks all.
|