From a31870d7648718ac7206f9d565c516d26ccbb09c Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 23 Jul 2020 09:21:02 +0200 Subject: [PATCH] fix parsing of history content - top_commands_full depends on the history which prefixes some commands wiht '*' as the history grows --- dot_zsh_functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index 053806d..3e4e8f9 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -132,7 +132,7 @@ function top_commands() { function top_commands_full() { local filter="$1" local max_results=${2:-'50'} - history | \cat | awk '{$1=$1};1' | sed 's/^[0-9 TAB]*//g' | awk '{CMD[$0]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "%\t" a; }' G "$filter" | sort --numeric-sort --reverse | nl H "-n$max_results" + history | \cat | awk '{$1=$1};1' | sed 's/^[0-9\* TAB]*//g' | awk '{CMD[$0]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "%\t" a; }' G "$filter" | sort --numeric-sort --reverse | nl H "-n$max_results" } # Where is a function defined? function whichfunc() {