#!/bin/bash #This script recursively travels the path provided #and generates a check sum for each file. The check sum #is written to an output file with the instrument directory #name as the extension. # #David Welsh #April 26, 2005 #Set the path export PATH=$HOME/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin outpath=/search/eureka/work #Check that there is one arguement if [ $# = 1 ]; then #change to the passed in directory cd $1 echo " "Generate check sum for files in "$1" #loop over the files in this directory. #If the file is a directory # then call this script again with the directory name # else generate a check sum of the file for f in * do if [ -d "$f" ]; then GenerateWorkCksum.bash "$f" else cksum "$f" >> "$outpath"/cksum_work."$1" fi done else echo Usage: GenerateWorkCksum.bash dir exit 1 fi