Zsh Mailing List Archive
Messages sorted by:
Re: maximum value for HISTSIZE ?
- X-seq: zsh-users 10123
- From: Andy Spiegl <zsh.Andy@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: maximum value for HISTSIZE ?
- Date: Sat, 1 Apr 2006 22:47:01 +0200
good to see that I'm not alone. :-)
> As a workaround I do the following:
Yep, same here.
Yesterday I wrote a simple perl script which will run weekly
and cleans up my history file.
Basically it does the following to delete all simple lines:
(watch out, it contains lots of personal aliases)
# `:<beginning time>:<elapsed seconds>;<command>'.
# Warning: <command> can contain multiple lines (with \ at line end)
my ($line, $cmd, $continued, $lastLinePrinted);
while ($line = <STDIN>)
if ($continued and $lastLinePrinted)
$continued=($line =~ /\\$/); # still continued?
# new history event
if (not $line =~ /^:[^:]+:[^;]+;(.*)$/)
print STDERR "skipping invalid zsh-history line in line $..\n";
$cmd = $1;
$continued=1 if $cmd =~ /\\$/;
# short commands/aliases without arguments
next if $cmd =~ /^(bb|ls|l|ltr|lS|cd)*$/;
# don't skip more complex commands
if (not $cmd =~ /&|;|\|/)
# short often used commands without options
next if $cmd =~ /^(l|ls|ll|lh|ltr|lltr|fff|xv|rm|rd|(d)?loc(ate)?|stat|g(un)?zip|b(un)?zip2|unzip|run-help|where|which|gimp|ping|(tk)?diff|cat|adr|kill|sr (google|ebay)|qiv-max|mutt|disown) +[^-]/;
# short often used commands with some options
next if $cmd =~ /^(rm -(r|rf)|l(s|l|h)? -(d|R|u)|rd -p|gzip -9|bzip2 -9|diff -r|du -(sh|h|s)) +[^-]/;
next if $cmd =~ /^cd (diario|~\/diario)/;
next if $cmd =~ /^(heute|diario|stunden)/;
# keep mplayer with options OR some arg with a colon
next if $cmd =~ /^\\?mplayer[^ ]* +[^-]/ and not $cmd =~ /^\\?mplayer[^ ]* +.*:/;
# okay, line ist interesting enough -> keep it
Suggestions are very welcome!
You should aim to be independent of any one vote, of any one fashion,
of any one century. (Baltasar Gracián, Spanish writer)
Messages sorted by: