From 68d16089922020bd5363fccd0903ca2ea96c8e8e Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Thu, 17 Mar 2016 10:05:47 +0000 Subject: [PATCH] Make the ps-graph script slightly less OS X-oriented. --- bin/ps-graph | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/ps-graph b/bin/ps-graph index 429e16a..1b8e2b4 100755 --- a/bin/ps-graph +++ b/bin/ps-graph @@ -239,4 +239,7 @@ function ps2gv { } [ ! -x "$(which neato 2>/dev/null)" ] && echo "neato(1) (graphviz) is not installed." && exit 1 -ps -eo ppid,pid,rss,pcpu,comm | awk '{ print "-", $0 }' | ps2gv | neato -Tpng -Nfontsize=12 -Elen=1.9 | open -f -a /Applications/Preview.app + +[ $(uname -s) = "Darwin" ] && ZONE="sess" + +ps -eo ${ZONE:=zone},ppid,pid,rss,pcpu,comm | ps2gv | neato -Tpng -Nfontsize=12 -Elen=1.9 | open -f -a /Applications/Preview.app