summaryrefslogtreecommitdiff
path: root/.power_unique.sh
diff options
context:
space:
mode:
Diffstat (limited to '.power_unique.sh')
-rw-r--r--.power_unique.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/.power_unique.sh b/.power_unique.sh
new file mode 100644
index 0000000..25fb530
--- /dev/null
+++ b/.power_unique.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+tmp=$(mktemp)
+while IFS= read -r line; do
+ echo $line >> $tmp
+done
+
+last_line=$(cat $tmp | tail -n1)
+cat $tmp | awk -F"," 'BEGIN{LAST=-1;skipped=0} {if(LAST!=$3){print $1","$2","$3;skipped=0}else{skipped=1} LAST=$3} END{if(skipped){print "'$last_line'"}}'
+rm $tmp
+