\t is not recognized, TAB is

This commit is contained in:
Morgan Wattiez 2019-07-25 09:03:39 +02:00
parent 8950d2dfd5
commit a0e9cb9f0b

View File

@ -62,5 +62,5 @@ function top_commands() {
history 1 | 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 1 | cat | sed 's/^[0-9 \t]*//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 1 | 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
}