Re: ksh history corruption

2011-09-01 Thread Amit Kulkarni
FWIW, I like this... makes it better for me to atleast grab some stuff and copy over ***if*** it corrupts again. thanks On Thu, Sep 1, 2011 at 3:22 PM, Marco Peereboom wrote: > Alright this diff keeps the file open and appends lines to HISTFILE. It > only rewrites HISTFILE at 125% of HISTSIZE.

Re: ksh history corruption

2011-09-01 Thread Marco Peereboom
Alright this diff keeps the file open and appends lines to HISTFILE. It only rewrites HISTFILE at 125% of HISTSIZE. Does fancy locking and deals with signals too. So unless someone finds some bugs I'll consider this version final. Yes, no on moving ksh history to text? Other comments? Index:

Re: ksh history corruption

2011-09-01 Thread Marco Peereboom
todd had his panties in a wad about backwards compatibility so I lifted the ksh history load code out of ksh to dump it in a text file. Compile like: "cc kshconv.c -o kshconv" then run it like: "./kshconv -i ~/.hist -o texthist" Conversion code: === 8< ===

Re: ksh history corruption

2011-08-31 Thread LEVAI Daniel
On Wed, Aug 31, 2011 at 14:42:26 -0500, Marco Peereboom wrote: > Version 4 fixes all reported bugs. > > Some folks have expressed doubt about the simplistic way of updating the > history file. Specifically the rewriting of all entries. I am > sensitive to that and know a couple of optimizations

Re: ksh history corruption

2011-08-31 Thread Marco Peereboom
On Wed, Aug 31, 2011 at 04:41:07PM -0400, Geoff Steckel wrote: > On 08/31/2011 03:42 PM, Marco Peereboom wrote: > >Version 4 fixes all reported bugs. > > > >Some folks have expressed doubt about the simplistic way of updating the > >history file. Specifically the rewriting of all entries. I am >

Re: ksh history corruption

2011-08-31 Thread Geoff Steckel
On 08/31/2011 03:42 PM, Marco Peereboom wrote: Version 4 fixes all reported bugs. Some folks have expressed doubt about the simplistic way of updating the history file. Specifically the rewriting of all entries. I am sensitive to that and know a couple of optimizations that can easily be appli

Re: ksh history corruption

2011-08-31 Thread Marco Peereboom
On Wed, Aug 31, 2011 at 07:20:42AM -0500, Marco Peereboom wrote: > On Wed, Aug 31, 2011 at 02:13:19PM +0200, LEVAI Daniel wrote: > > On Wed, Aug 31, 2011 at 06:57:34 -0500, Marco Peereboom wrote: > > > On Wed, Aug 31, 2011 at 11:59:29AM +0200, LEVAI Daniel wrote: > > > > On Tue, Aug 30, 2011 at 13:

Re: ksh history corruption

2011-08-31 Thread Marco Peereboom
On Wed, Aug 31, 2011 at 02:13:19PM +0200, LEVAI Daniel wrote: > On Wed, Aug 31, 2011 at 06:57:34 -0500, Marco Peereboom wrote: > > On Wed, Aug 31, 2011 at 11:59:29AM +0200, LEVAI Daniel wrote: > > > On Tue, Aug 30, 2011 at 13:55:57 -0500, Marco Peereboom wrote: > > > > On Tue, Aug 30, 2011 at 11:11

Re: ksh history corruption

2011-08-31 Thread LEVAI Daniel
On Wed, Aug 31, 2011 at 06:57:34 -0500, Marco Peereboom wrote: > On Wed, Aug 31, 2011 at 11:59:29AM +0200, LEVAI Daniel wrote: > > On Tue, Aug 30, 2011 at 13:55:57 -0500, Marco Peereboom wrote: > > > On Tue, Aug 30, 2011 at 11:11:46AM -0500, Marco Peereboom wrote: > > > > I have had enough of corru

Re: ksh history corruption

2011-08-31 Thread Marco Peereboom
On Wed, Aug 31, 2011 at 11:59:29AM +0200, LEVAI Daniel wrote: > On Tue, Aug 30, 2011 at 13:55:57 -0500, Marco Peereboom wrote: > > On Tue, Aug 30, 2011 at 11:11:46AM -0500, Marco Peereboom wrote: > > > I have had enough of corrupt ksh history so I had a look at the code to > > > try to fix it. The

Re: ksh history corruption

2011-08-31 Thread LEVAI Daniel
On Tue, Aug 30, 2011 at 13:55:57 -0500, Marco Peereboom wrote: > On Tue, Aug 30, 2011 at 11:11:46AM -0500, Marco Peereboom wrote: > > I have had enough of corrupt ksh history so I had a look at the code to > > try to fix it. The magical code was very magical so I basically deleted > > most of it a

Re: ksh history corruption

2011-08-30 Thread Marco Peereboom
On Tue, Aug 30, 2011 at 11:11:46AM -0500, Marco Peereboom wrote: > I have had enough of corrupt ksh history so I had a look at the code to > try to fix it. The magical code was very magical so I basically deleted > most of it and made ksh history into a flat text file. It handles > multiple ksh i

ksh history corruption

2011-08-30 Thread Marco Peereboom
I have had enough of corrupt ksh history so I had a look at the code to try to fix it. The magical code was very magical so I basically deleted most of it and made ksh history into a flat text file. It handles multiple ksh instances writing to the same text file with locks just like the current k