Index: mttroot/mtt/bin/mtt_find ================================================================== --- mttroot/mtt/bin/mtt_find +++ mttroot/mtt/bin/mtt_find @@ -12,10 +12,18 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.5 1998/07/17 07:50:33 peterg +## Now handles library name +## Returns a status +## 0 if exactly one result +## 1 if no results +## 2 if two or more results +## 3 if utterly confused +## ## Revision 1.4 1998/07/16 20:40:24 peterg ## Cleaned up algorithms ## ## Revision 1.3 1998/07/16 09:15:34 peterg ## Now prints: @@ -42,10 +50,12 @@ name=`basename $2` longname=$2 Name="-name $name" fi +# If this is non-empty just print the path +path_only=$3 # Find all dirs in path with same name as component # AND the path contains the full (name+library) name paths=`echo $path | tr ":" " "` foundpath=`\ @@ -57,14 +67,19 @@ # If non-null result, check that the name_lbl.txt file exists in dir name # and print dirname and file name and last access time if [ -n "$foundpath" ]; then + if [ -n "$path_only" ]; then + format='%h\n'; + else + format='%h\t%f\t%Ac\n'; + fi for thepath in $foundpath ; do dirname=`echo $thepath | awk -F/ '{print $NF}'` fullname="$dirname"_lbl.txt - find $thepath -maxdepth 1 -name $fullname -printf '%h\t%f\t%Ac\n'; + find $thepath -maxdepth 1 -name $fullname -printf $format; done |\ tee mtt_junk fi # Check exit status and return