You're viewing a comment by Kent Fredric and its responses.

Kent Fredric Permalink
June 03, 2010, 00:35

You can do that awk command just as easily with perl, but its a bit longer.

history | 
  perl -nle '$_=~s/\s*\d*\s*//; 
              @foo = sort { -( $a->[0] <=> $b->[0] ) } 
                      map { [ $cache{$_}, $_ ] } 
                       keys %cache ; 
              print "@{$foo[$_]}" for 0..10 

I love that perl-butterfly operator :)

( line feeds added for clarity. )

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "sandbox_222": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.