#!/bin/bash # Script --------------------------------------------------------------------- # Program : hfind.sh # Author : Jay Fink # Purpose : Use a best guess to track down header files. # Really primitive - could probably be better but it works. # # $Author: jayrfink $ # $Date: 2007/08/28 00:14:42 $ # $State: Exp $ #----------------------------------------------------------------------------- program=${0##*/} toppid=$$ ldpaths="/usr/include /usr/local/include /opt /usr" passmax=4 trap "exit 1" 1 2 3 15 #----------------------------------------------------------------------------- # bomb - Simple death routine; display ERRORMESSAGE, kill toppid and exit. # # requires: ERRORMESSAGE # returns : exit 1 #----------------------------------------------------------------------------- bomb() { cat >&2 </dev/null) case $opt in f) shift;filename=$1;; p) shift;passes=$1;; s) showpaths;exit 0;; u) usage;exit 0;; v) verbose=1;; *) usage;exit1;; esac shift done if [ ! $filename ]; then echo "Error: No filename specified" usage exit 1 fi search $passes $filename