1#!/bin/sh
2
3# Generate LocaleKit's CountryFlags.rdef
4# from all flag rdefs in the current folder
5
6destination=CountryFlags.rdef
7nr=0
8
9for file in *
10do
11	id=`echo "$file" | cut -b -2`
12	name=`echo "${file%%.*}" | cut -b 4-`
13
14	echo "// Flag data for $name" >> $destination
15	echo "resource($nr,\"$id\") #'VICN' array {" >> $destination
16	tail -n +3 "$file" >> $destination
17	echo >> $destination
18
19	nr=`expr $nr + 1`
20	echo \ $nr, $name, $id... OK
21done
22