From fa264280983bd9439589c0c336736e2caa9baf2c Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Fri, 3 Jul 2020 08:13:38 +0200 Subject: [PATCH] trim line ending spaces for history output --- dot_zsh_functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index 6d19ec1..6fe0b9b 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -99,7 +99,7 @@ function top_commands() { history | \cat | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a; }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n50 } function top_commands_full() { - history | \cat | sed 's/^[0-9 TAB]*//g' | awk '{CMD[$0]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "%\t" a; }' | sort -nr | nl | head -n50 + 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; }' | sort -nr | nl | head -n50 } function istherenewissues() { LASTISSUE=$(newissues | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g' | awk 'FNR==2{print $2}')