From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 1 Apr 2006 22:47:01 +0200 From: Andy Spiegl To: zsh-users@sunsite.dk Subject: Re: maximum value for HISTSIZE ? Message-ID: <20060401204701.GA12251@spiegl.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Seq: zsh-users 10123 Hi Carlos, 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) # `::;'. # Warning: can contain multiple lines (with \ at line end) my ($line, $cmd, $continued, $lastLinePrinted); $lastLinePrinted=0; while ($line = ) { if ($continued and $lastLinePrinted) { print $line; $continued=($line =~ /\\$/); # still continued? next; } # new history event if (not $line =~ /^:[^:]+:[^;]+;(.*)$/) { print STDERR "skipping invalid zsh-history line in line $..\n"; next; } $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)) +[^-]/; # specials 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 print $line; $lastLinePrinted=1; } Suggestions are very welcome! Bye, Andy. -- You should aim to be independent of any one vote, of any one fashion, of any one century. (Baltasar Gracián, Spanish writer)