From: Siraaj Khandkar Date: Mon, 16 Dec 2019 21:07:13 +0000 (-0500) Subject: Add viz_cmd_usage_zsh_history.sh X-Git-Url: https://git.xandkar.net/?p=snip.git;a=commitdiff_plain;h=530205227ce88186063e1eb28f0e104fe2c0ba5e;ds=sidebyside Add viz_cmd_usage_zsh_history.sh --- 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 -