#!/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 #Check that there is one arguement if [ $# = 1 ]; then #get the USB disk mount point read diskpath < $HOME/search/diskpath #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 GenerateCksum.bash "$f" else if [ -d "$diskpath"/search ]; then cksum "$f" >> "$diskpath"/cksum."$1" fi fi done else echo " "Usage: GenerateCksum.bash dir exit 1 fi