Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: combine/merge .history?



On Oct 13,  1:33pm, Ray Andrews wrote:
} Subject: Re: combine/merge .history?
}
} On 10/13/2014 10:59 AM, Bart Schaefer wrote:
} 
} Bart:
} 
} > }   1074* c Boot
} > }   1075* e zshrc
} > }   1076* A
} > }   1077* man pv
} >
} > ... doesn't look like anything zsh ever saved
} 
} pts/2 HP-y5--5-Debian1 root / $ history
}   1086* W
}   1087* l ,m
}   1088* hdparm -C /dev/sda
}   1089* cat .histfile
} 
} ... so that seems to be plain vanilla history output, no? 

Sorry, I thought you were giving examples of file contents, not examples
of the output of the "history" command.  I didn't recognize it because I
never use SHARE_HISTORY and forgot that "foreign" history entries get
marked with a "*".

So ... if the format of entries *in the two files* looks similar, you
should be OK to combine them.  If both of them have the extended format
(timestamp:elapsed;command) then you should be able to merge them and
sort the result by timestamp without any major problems.

Just beware of multi-line entries, e.g., a plain "sort -n" will garble
those badly.



Messages sorted by: Reverse Date, Date, Thread, Author