save commands history.

Ben Yau byau at cardcommerce.com
Tue Mar 16 21:38:38 UTC 2004


> On Tue, Mar 16, 2004 at 09:00:33AM -0800, Ben Yau wrote:
> > > > And what prevents him from clearing the log in his logout script?
> > > > You'll just get a nice empty file mailed to you every time he logs
> > > > in....
> > > >
> > > True, I didn't know how linux savvy of a user he was dealing
> with. Ours
> > > wasn't and this worked for us.
> > >
> >
> > Actually, even if he empties it on logout, it will still write
> the commands
> > from that login sessoin.  bash will write the command history
> as the last
> > step of logging out.  Try it out yourself . Put
> >
> > echo "" > ~/.bash_history
>
> Replace that with:
> history -c
>
> Poof, history gone.  Verified.
>

Nice.. Learn something new every day.

In which case we start getting into more convuluted ways like compiling a
wrapper around bash to not use the history -c or else to output
username/command to a file.

But it does'nt look like there isn't a clean way to do it.

Ben










More information about the redhat-list mailing list