File: missing-countries.sh

package info (click to toggle)
namebench 1.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,808 kB
  • ctags: 494
  • sloc: python: 4,047; sh: 116; makefile: 17
file content (9 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/bin/sh
# Display a list of countries that have no coverage
cat ../config/namebench.cfg | perl -ne 'chomp; if (/[0-9a-f]=.* (\w\w)$/) { print "$1\n"; }' | sort -u > /tmp/iso.has
echo "Countries listed: `wc -l /tmp/iso.has`"
cat ../data/ISO_31661-1.codes| perl -ne 'if (/ +(\w\w)$/) { print "$1\n"; }' > /tmp/iso.codes
echo "Countries total: `wc -l /tmp/iso.codes`"
cat /tmp/iso.has /tmp/iso.has /tmp/iso.codes | sort | uniq -u > /tmp/iso.missing
cat /tmp/iso.missing | xargs -I{} -n1 grep " {}$" ../data/ISO_31661-1.codes
echo "Countries missing: `wc -l /tmp/iso.missing`"