From 530205227ce88186063e1eb28f0e104fe2c0ba5e Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Mon, 16 Dec 2019 16:07:13 -0500 Subject: [PATCH] Add viz_cmd_usage_zsh_history.sh --- viz_cmd_usage_zsh_history.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 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 - -- 2.20.1