>>403
こんなので使えますか?

#!/bin/sh -
LIST="/home/share/list"
KEY_LIST="/home/share/key_list"

awk -F/ '
{
for(i = NF; i >= 1; --i) {
for(j = i; j <= NF; ++j) {
if(j == 1) {
sizeOfArray = split($j,array," ")
result = array[sizeOfArray]
}
else if(j == i) result = $j
else result = result"/"$j
}
count = system ("grep -c " result" ""'$LIST'"" >/dev/null 2>&1")
result = ""
if(count == 1) {
ok++
break
}

}
ng++
}
END {
printf("%04d\n%04d\n", ok, ng)
}