#!/bin/sh # #NAME # FindHdrFiles - find *.h files. # #SYNOPSIS # FindHdrFiles # #DESCRIPTION # Find all header files in the current system, and write their names # to ~/`hostname`/HdrFiles. Note that the find command usually # refuses to follow symbolic links, so we have to use such overkill # to find things. # # This version is set up to work in a multi-machine environment, # with the $HOME directory NFS-mounted on several development # machines. We create a $HOME/$HOSTNAME directory, and write our # output to the HdrFiles file in that directory. The result is a set # of directories named after each of the development host machines, # and HdrFiles as a list of where each machine's header files may be # found. You should run this program on each machine as part of the # initial setup. # #BUGS # We probably won't have permission to access all the directories on # the system. Note that we discard stderr, which is mostly a list of # the permission problems. You might want to redirect stderr to a # file in $D instead. # #AUTHOR # John Chambers if [ ! -n "$HOSTNAME" ];then HOSTNAME=`hostname`; fi D=$HOME/$HOSTNAME test -d $D || mkdir -p $D cp /dev/null $D/HdrFiles ls -la $D/ Ln $D/HdrFiles . find / -name '*.h' -print >>$D/HdrFiles 2>/dev/null