X-Git-Url: https://git.xandkar.net/?p=snip.git;a=blobdiff_plain;f=viz_cmd_usage_zsh_history.sh;h=7fd34f19dfe055a4db3f04bda6739ef9de88da5a;hp=909495c8accf75ddef3fb096a4f8e63a808a59df;hb=d9de1240e3d2057ff87fe2f99c29bf80f18036bd;hpb=530205227ce88186063e1eb28f0e104fe2c0ba5e diff --git a/viz_cmd_usage_zsh_history.sh b/viz_cmd_usage_zsh_history.sh old mode 100644 new mode 100755 index 909495c..7fd34f1 --- a/viz_cmd_usage_zsh_history.sh +++ b/viz_cmd_usage_zsh_history.sh @@ -1,3 +1,5 @@ #! /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 - +# First pipe member may need to be modified for a desired history file (path and splitting). + +awk -F';' '{sub("^" $1 ";", ""); print}' ~/.zsh_history | 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 -