cleanup-timesamples: optional pre/post editing
authorDan White <dan@whiteaudio.com>
Sat, 7 Dec 2013 20:13:52 +0000 (14:13 -0600)
committerDan White <dan@whiteaudio.com>
Sat, 7 Dec 2013 20:13:52 +0000 (14:13 -0600)
cleanup-timesamples

index dd2763f850838f06454778361049e2a6fba3373d..7bf95c142d5ec17880ecbc07170da45314ec4776 100755 (executable)
@@ -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