From d3af22ba6dc907e5b4038e47deb21d82e59be466 Mon Sep 17 00:00:00 2001 From: Dan White Date: Sat, 7 Dec 2013 14:13:52 -0600 Subject: [PATCH] cleanup-timesamples: optional pre/post editing --- cleanup-timesamples | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cleanup-timesamples b/cleanup-timesamples index dd2763f..7bf95c1 100755 --- a/cleanup-timesamples +++ b/cleanup-timesamples @@ -3,6 +3,13 @@ # cleanup data from timeSampler, # removes null entries and sorts by time +# -e edits before cleanup +# -E edits after cleanup +if [ "$1" = "-e" ]; then + vim $HOME/.timeSampler.$HOSTNAME + shift +fi + TMPFILE=$(tempfile) for f in $(ls -1 $HOME/.timeSampler.*); do grep -v "null$" $f | sort > $TMPFILE @@ -10,3 +17,7 @@ for f in $(ls -1 $HOME/.timeSampler.*); do done rm -f $TMPFILE + +if [ "$1" = "-E" ]; then + vim $HOME/.timeSampler.$HOSTNAME +fi -- 2.25.1