Results 1 to 1 of 1
I have access to a machine using a shared account (bad idea I know, but I have no control over it).
I have set up my SSH client to execute ...
- 03-12-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 1
How to maintain independent bash history?
I have access to a machine using a shared account (bad idea I know, but I have no control over it).
I have set up my SSH client to execute commands immediately upon login that change $HOME to a custom directory and to source a custom .bashrc file in that directory, in an effort to try to maintain a custom environment separate from the main environment of the shared account.
I have also created my own .bash_history file, and in my custom .bashrc file I set HISTFILE to point to it. The idea being, I want to have my own history and not be forced to sort through other users commands.
But what happens in this scheme is that the commands I execute are appended to my custom .bash_history (good), but whenever I login the history list is populated from the original .bash_history for the user I'm logging in as - like that population happens before all the hijinks I'm doing with custom files and the HISTFILE variable. The upshot is that I have my history available in my custom .bash_history file, but it's not being reflected in the actual history list. I.e. when up-arrow, I get the wrong history.
So my question is, can I execute a command that will reload the history list from my custom .bash_history file? Or alternatively, does anyone have any suggestion of perhaps a totally different way of accomplishing my goal here (understanding that I can't just have an account created for me on this machine)?
Thanks


Reply With Quote