#!/bin/bash
##############################################################
# name: squelette.sh
# version: 0.0
# description: pulls the logical skeleton out of a source code
# file and puts it into another file
# synopsis: positional argument $1 is the language (e.g., 'sql')
# positional argument $2 is the source code file
# (e.g., '/home/ronin/personal/thirtydaysago.c')
# created by: David Clement
# date: 23-JUN-2004
# modified by:
# date:
##############################################################
l=$1
f=$2
t="${f%%\.*}".skeleton
rm -f "$t"
for i in $( cat ~/squelette/${l}keys.txt )
do
grep -in "\<$i\>" "$f" >> "$t"
done
sort -un "$t" -o "$t"