Re: I Need Help...
- From: Mike Touloumtzis <miket bluemug com>
- To: eeyem u washington edu
- Cc: Yosalfa Rinaldi Chaer <yosalfa cbn net id>, gnome-devel-list gnome org
- Subject: Re: I Need Help...
- Date: Thu, 23 Mar 2000 21:11:15 -0800
On Wed, Mar 22, 2000 at 10:48:41AM -0800, eeyem@u.washington.edu wrote:
>
> Where is .id ?
If you're using Debian with the doc-iana package installed or
otherwise have the file /usr/doc/doc-iana/assignments/country-codes.gz,
you may find the attached script handy at times like these :-).
miket
#! /bin/sh
#
# country code table grep
#
if [ -z "$1" ]; then
echo "usage: country <code> or country <name>"
exit 1
fi
CODE=`echo $1 | tr a-z A-Z`
FILE=/usr/doc/doc-iana/assignments/country-codes.gz
if [ `expr length $CODE` \< 3 ]; then
zcat $FILE | \
grep "[[:space:]]\+$CODE[[:space:]]\+[[:upper:]]\{3\}[[:space:]]\+[0-9]\{3\}$"
if [ $? ]; then exit; fi
fi
if [ `expr length $CODE` \< 4 ]; then
zcat $FILE | \
grep "[[:upper:]]\{2\}[[:space:]]\+$CODE[[:space:]]\+[0-9]\{3\}$"
if [ $? ]; then exit; fi
fi
zgrep $CODE $FILE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]