find serial port and connect to it
[zc] / sql-grep-to-ids.sh
1 #!/bin/sh -e
2
3 ids=$( grep $1 subvision-numbers.txt | awk '{ print $2 }' | xargs echo -n | sed 's/ /,/g' )
4 #echo "select pn,count(pn),min(time),max(time) from zc where pn in ($ids) group by pn order by max" | psql zc
5 echo "select (select sub from sub where pn = zc.pn),(select name from sub where pn = zc.pn),pn,count(pn),min(time),max(time) from zc where pn in ($ids) group by pn order by max" | psql zc
6 echo "select * from zc where pn in ($ids) order by time | psql zc"