#! /bin/bash # # Filename: findfirst # # Programmer: Br. David Carlson # # Date: February 28, 2003 # # This script finds the first file within the directory tree rooted at the first command-line # parameter that matches the target given as the second command-line parameter. Output is # to standard out and gives the full pathname of the located file or a not found message. # Note that this script assumes that it has access to all directories in the above-mentioned # directory tree. If this is not true, you will get error meessages and be left with # temporary files in /tmp. # # Helping script used: # findfirst.onedir # # Syntax: # findfirst StartDir TargetFilename if [ $# -ne 2 ] then echo "Error: 2 parameters are needed" echo "Syntax: findfirst StartDir TargetFilename" exit 1 fi findfirst.onedir "$1" "$2" # check the exit status of the findfirst.onedir script: if [ $? -ne 0 ] then echo "No match was found" fi exit 0