diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2024-01-21 11:07:50 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2024-01-21 11:07:50 +0100 |
| commit | bcd7e7f5ff6e532c512c3c9ab43a65030417e63a (patch) | |
| tree | e8459d9363e0a348a636a723bcdba54df500d21d /.power_unique.sh | |
| parent | 0d8b138f10f38e3b1e58ee02e50495c079c3df35 (diff) | |
Minor changes
Diffstat (limited to '.power_unique.sh')
| -rw-r--r-- | .power_unique.sh | 11 |
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 + |
