home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Telecom
/
1996-04-telecom-walnutcreek.iso
/
country.codes
/
london.ac.script
/
london
next >
Wrap
Text File
|
1990-01-19
|
1KB
|
51 lines
#! /bin/sh
PROG=$0
DB=/staff/pkh/telephones/LONDON
error () { echo "$PROG: $1" 1>&2 ; exit "$2" ; }
b=`echo $* | sed "s/-/ /g"`
set $b
case $# in
2) case $1 in
0*) error "Usage [AREA] EXCHANGE NUMBER
(space or - separated)" "2" ;;
*) AREA="01" ;;
esac ;;
3) AREA=$1;
case $AREA in
01) shift;;
*) error "Area code $AREA does not need conversion." 3 ;;
esac ;;
*) error "Usage AREA EXCHANGE NUMBER
(space or - separated)" "2" ;;
esac
EXCHANGE=$1
NUMBER=$2
c=`grep $EXCHANGE $DB | grep -v \#`
if [ $? -eq 1 ]
then echo "The $EXCHANGE exchange code is outside of the range used in London."
exit
fi
set $c
N_AREA=$2
if [ "$N_AREA" = "071" ]
then LOCATION="Inner London"
else LOCATION="Outer London"
fi
case $N_AREA in
U) echo "The $EXCHANGE exchange code is at present unused in London,
though it is in the range of other codes that will be in the new 071 area." ;;
V) echo "The $EXCHANGE exchange code is at present unused in London,
though it is in the range of other codes that will be in the new 081 area." ;;
W) echo "The $EXCHANGE exchange code is at present unused in London." ;;
*) echo "The new number for London $AREA-$EXCHANGE $NUMBER from Sunday 6th May 1990 will be:
$LOCATION $N_AREA-$EXCHANGE $NUMBER" ;;
esac