ldapsearch -Z 'gentooStatus=active' -LLL gentooLocation |grep gentooLocation | grep -v '::' |cut -d: -f2- | sort | sed \ -r -e 's,.*(USA|Canada)$,\1,' \ -e 's,.*(Channel|England|Kingdom|Scotland|UK).*,British Isles,g' \ -e 's,.*(TX|MA|US|OR|NY|CA|NC|MN|California|Missouri|Ohio|Florida|Oklahoma|Silicon Valley|Illinois).*,USA,g' \ -e 's,.*(Germany|Poland|Belgium|France|Spain|Italy|Netherlands|Switzerland|Denmark|Czech|Austria|Finland|Sweden|netherlands|Slovakia|Portugal|Romania|Estonia|Groningen|Norway).*,EU,g' \ -e 's/.*,//g' \ |sort -n | uniq -c | awk '{printf "%5d %s %s %s\n",$1,$2,$3,$4}' | sort -n ldap_start_tls: Connect error (-11) additional info: TLS: hostname does not match CN in peer certificate 1 Chile 1 China 1 Colombia 1 Itajuba 1 New Zealand 1 South Africa 1 Vietnam 2 Argentina 2 Brazil 2 India 2 Venezuela 3 Israel 3 Russia 5 Australia 8 Japan 11 Canada 18 undefined 31 British Isles 88 USA 138 EU