[H-GEN] any faster way?
Michael Dooley
m.dooley at mailbox.uq.edu.au
Tue Jun 16 06:58:15 EDT 1998
Hi,
I've got database (read 'directory') of around 4000 files that
I'm trying to tidy up (remove files with <5 lines) and see which files
I've deleted since I created my master database list. This is what I
came up with, but the find is s-l-o-w. Is there another faster
approach?
verify_db.csh < MASTER_DB_LIST
verify_db.csh
#!/bin/csh -f
set entry = $< #read a line of input from MASTER_DB_LIST
while ($entry != 'EOF')
if (-e /databases/caveat/disulf_fix/$entry) then #if file exists
find /databases/caveat/disulf_fix/ -name $entry -exec small.nawk {} \;
#check if file >5 lines
else
echo $entry #print name if file doesn't exist
endif
set entry = $< #update file name
end #excuse crappy formatting
small.nawk
nawk '
{next}
{if (NR >5){exit}}
END {if (NR <5){print FILENAME}}
' $1
Cheers
Michael
m.dooley at mailbox.uq.edu.au
More information about the General
mailing list