|
root / base / usr / src / data / zoneinfo / do_pofile.sh
do_pofile.sh Bash 69 lines 1.0 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#

#
# Create messages file for zone_sun.tab, country.tab, continent.tab
#
AWK=/usr/bin/nawk
ECHO=/bin/echo

ZONE_SUN_FILE=zone_sun.tab
COUNTRY_FILE=country.tab
CONTINENT_FILE=continent.tab

DOMAIN=SUNW_OST_ZONEINFO

$ECHO "domain \"$DOMAIN\""

$ECHO "#"
$ECHO "# These files are located in usr/src/data/zoneinfo"
$ECHO "#"

$ECHO "#"
$ECHO "# continent.tab"
$ECHO "#"

# Get 2nd column of continent.tab file
$AWK -F'\t' \
	'
	/^#/ { next }
	{
		printf "msgid \"%s\"\n", $2
		printf "msgstr \"\"\n"
	}
	' < $CONTINENT_FILE

$ECHO "#"
$ECHO "# country.tab"
$ECHO "#"

# Get 2nd column of country.tab file
$AWK -F'\t' \
	'
	/^#/ { next }
	{
		printf "msgid \"%s\"\n", $2
		printf "msgstr \"\"\n"
	}
	' < $COUNTRY_FILE


$ECHO "#"
$ECHO "# zone.tab"
$ECHO "#"

# Get 5th column (if it exists) of zone_sun.tab file
$AWK -F'\t' \
	'
	/^#/ { next }
	{
		if (NF > 4) {
			printf "msgid \"%s\"\n", $5
			printf "msgstr \"\"\n"
		}
	}
	' < $ZONE_SUN_FILE