X-Git-Url: https://git.xandkar.net/?p=snip.git;a=blobdiff_plain;f=viz_cmd_usage_zsh_history.sh;fp=viz_cmd_usage_zsh_history.sh;h=909495c8accf75ddef3fb096a4f8e63a808a59df;hp=0000000000000000000000000000000000000000;hb=530205227ce88186063e1eb28f0e104fe2c0ba5e;hpb=5a8e675c8e2d76d5e4b790d4d4a5f5dff29ee220 diff --git a/viz_cmd_usage_zsh_history.sh b/viz_cmd_usage_zsh_history.sh new file mode 100644 index 0000000..909495c --- /dev/null +++ b/viz_cmd_usage_zsh_history.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +awk -F';' '{sub("^" $1 ";", ""); print}' ~/.zsh_history | awk '{print $1}' | awk '{curr = $1; links[NR, prev] = curr; prev = curr} END {printf "digraph G {"; for (node in links) {split(node, n, SUBSEP); printf "\"%s\" -> \"%s\"\n", n[2], links[node]}; printf "}\n"}' | neato -T png | feh -