mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-06 03:46:25 +02:00
12 lines
289 B
Bash
12 lines
289 B
Bash
|
#!/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
|
||
|
|