Here is a script that will list the mag cells with...
# general
m
Here is a script that will list the mag cells with port conficts.
Copy code
#! /bin/bash
  
awk '
/label/ {
    label = $NF;
}
/^port/ {
    print FILENAME, label, $2;
}
 {
    if ( last_file != $1 ) {
        last_file = $1;
        count = 1;
    } else {
        count = count + 1;
    }
}' $* | \
    sort -u -k1,1 -k3,3n | \
    awk '
 {
    if ( last_file != $1 ) {
        last_file = $1;
        count = 1;
    } else {
        count = count + 1;
    }
}
$NF != count {
    print $0, count;
}'
I named it
check_ports
and ran it as
check_ports *.mag