#!/bin/csh if ( -d $1 ) then ls -la $1/*.shape $1/*/*.shape > sos.sos awk 'BEGIN {printf "\n#include \"../headers.h\"\n#define GFX_SHAPE\n\n";sum=0}{printf "#include \"%s\"\nstatic long long patch_%d = %d;\n",$9,sum,sum;sum++}' sos.sos > gfx_$1.c awk 'BEGIN {printf "\n#include \"../headers.h\"\n#define HMS_SHAPE\n\n"}{printf "#include \"%s\"\n",$9}' sos.sos > hms_$1.c ls -la *_$1.c echo ================== echo ==== Complete ==== echo ================== else echo ----- Error ------- echo Directory Not Found echo ------------------- endif