Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!rutgers!att!ihnp4!ihlpf!gmark From: gmark@ihlpf.ATT.COM (Stewart) Newsgroups: comp.sys.att Subject: Re: Questions from a new user (SUMMARY) Summary: trap Keywords: ksh history Message-ID: <5626@ihlpf.ATT.COM> Date: 12 Aug 88 02:50:46 GMT References: <620@gvgspd.GVG.TEK.COM> <11300001@osiris.cso.uiuc.edu> <226@ssbn.WLK.COM> Distribution: na Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 24 In article <226@ssbn.WLK.COM>, bill@ssbn.WLK.COM (Bill Kennedy) writes: > In article <11300001@osiris.cso.uiuc.edu> hood@osiris.cso.uiuc.edu writes: > >A very simple solution to the problem of multiple history files is to > >tack on the process ID to the file name. > > HISTFILE=$HOME/.history$$ > > > >Works for me... > ... > Not to be a nit picker, but how do you get rid of them when you log out? Yeah, I posted something like that, awhile back and it works fine. Just add a trap instruction in your login file (.profile) that appends your particular .historyXXXX to the main .history (assuming that's what you want to do). If you're trying to separate the history files of multiple layers, and not truly separate logins, the trap instruction will execute when the last layer dies (you log out). If you do this for multiple logins, checking the process IDs doesn't sound THAT inelegant. This will work for all the .historyXXXXs. Pretty handy. - Mark G. Mark Stewart ATT_BTL, Naperville, Ill. ix1g266 ixlpq!gms (312)979-0914