1 #! /bin/sh
   2 #
   3 # Copyright (c) 2001 by Sun Microsystems, Inc.
   4 # All rights reserved.
   5 #
   6 # ident "%Z%%M% %I%     %E% SMI"
   7 
   8 #
   9 # Create messages file for zone_sun.tab, country.tab, continent.tab
  10 #
  11 AWK=/usr/bin/nawk
  12 ECHO=/usr/bin/echo
  13 
  14 ZONE_SUN_FILE=zone_sun.tab
  15 COUNTRY_FILE=country.tab
  16 CONTINENT_FILE=continent.tab
  17 
  18 DOMAIN=SUNW_OST_ZONEINFO
  19 
  20 $ECHO "domain \"$DOMAIN\""
  21 
  22 $ECHO "#"
  23 $ECHO "# These files are located in usr/src/cmd/zic."
  24 $ECHO "#"
  25 
  26 $ECHO "#"
  27 $ECHO "# continent.tab"
  28 $ECHO "#"
  29 
  30 # Get 2nd column of continent.tab file
  31 $AWK -F'\t' \
  32         ' 
  33         /^#/ { next }
  34         { 
  35                 printf "msgid \"%s\"\n", $2 
  36                 printf "msgstr \"\"\n"
  37         }
  38         ' < $CONTINENT_FILE
  39 
  40 $ECHO "#"
  41 $ECHO "# country.tab"
  42 $ECHO "#"
  43 
  44 # Get 2nd column of country.tab file
  45 $AWK -F'\t' \
  46         ' 
  47         /^#/ { next }
  48         { 
  49                 printf "msgid \"%s\"\n", $2 
  50                 printf "msgstr \"\"\n"
  51         }
  52         ' < $COUNTRY_FILE
  53 
  54 
  55 $ECHO "#"
  56 $ECHO "# zone.tab"
  57 $ECHO "#"
  58 
  59 # Get 5th column (if it exists) of zone_sun.tab file
  60 $AWK -F'\t' \
  61         ' 
  62         /^#/ { next }
  63         { 
  64                 if (NF > 4) {
  65                         printf "msgid \"%s\"\n", $5 
  66                         printf "msgstr \"\"\n"
  67                 }
  68         }
  69         ' < $ZONE_SUN_FILE
  70