#!/bin/bash
# cat /var/lib/misc/dnsmasq.leases | while read line; do loctet=$(echo $line | cut -f 4 -d . | cut -f 1 -d " "); printf "${line}\t"; sed -n "$loctet{p;q}" < <(tr ":" "," < /etc/workshopnames.yml | cut -f 1,3 -d, | tr , "\t") ; done | cut -b 30- | sort -b -k 2,2V | column -t
cat /var/lib/misc/dnsmasq.leases | cut -d' ' -f3-4 |
while read -r line; do
    loctet=$(echo "$line" | cut -d'.' -f4 | cut -d' ' -f1)
    printf '%s\t' "$line"
    sed -n "${loctet}{p;q}" < <(
        tr ':' ',' < /etc/workshopnames.yml |
        cut -d',' -f1,3 |
        tr ',' '\t'
    )
done |
# cut -b30- |
sort -b -k2,2V |
column -t
