#!/bin/bash # it is 1 am and im still heading to finish this tonight :) # written by palmers / teso IN_FILE="../tmp/_names" OUT_FILE="../include/addresses.h" NUM_FILE="../util/_numbers" X=1 LINE_COUNT=`wc -l $IN_FILE | awk '{print $1}' -` cat << __EOF__ >> $OUT_FILE /* * addresses.h: * this file was automaticly generated by gen_defines */ __EOF__ while [ `expr $X \<\= $LINE_COUNT` == "1" ]; do # did i already mention how late it is? dont try to understand the next line ... echo \#define `sed -n \`echo $X\`p $IN_FILE | awk '{print toupper ($1)}' -`_ADD `sed -n \`echo $X\`p $NUM_FILE` >> $OUT_FILE X=`expr $X \+ 1` done