Thanks erik, It is not easy to get small sample. I tried to make smaller sample discarding the first line of pattern file and target file. the problem depends not only pattern file but also target file! it is curious why grep does not give conclusion to each line that is read from target file.
my result is shown below. t0 and t1 are target file z0 and z1 are pattern file term% echo $t e54272690d513f8b2403568a7574b1ba term% grep -n $t z0 z1 t0 t1 z0:4081: e54272690d513f8b2403568a7574b1ba z1:4082: e54272690d513f8b2403568a7574b1ba t0:4298: e54272690d513f8b2403568a7574b1ba /usr/arisawa/src/taskfs/Q/task.387.a/ t1:4299: e54272690d513f8b2403568a7574b1ba /usr/arisawa/src/taskfs/Q/task.387.a/ term% wc z0 z1 t0 t1 4575 4575 150975 z0 4576 4576 151008 z1 4583 9166 388702 t0 4584 9168 388756 t1 18318 27485 1079441 total term% diff -c z0 z1 z0:1,3 - z1:1,4 + 00775d6a004acb79a2cd3ec30f743a9e 008de90ca02f6c4f10e2f172e0511105 00cfd51ea3ea1152f98c1f90130be7d0 00cff9d5f2b4d08753f96564dac50a58 term% diff -c t0 t1 t0:1,3 - t1:1,4 + f104706a82b7c20e0f2c3cf83033958c /usr/arisawa/bin/rc/ 521db7c46291f0785d8d77f8e614350a /usr/arisawa/bin/rc/photo/ e76b64877aea9c8b4dcc24069436d52d /usr/arisawa/lib/ 1d6ca6d83f5f51ebfdd94fea02a9fb8b /usr/arisawa/lib/cookies/ term% grep -f z0 t0 | grep $t e54272690d513f8b2403568a7574b1ba /usr/arisawa/src/taskfs/Q/task.387.a/ term% grep -f z1 t0 | grep $t e54272690d513f8b2403568a7574b1ba /usr/arisawa/src/taskfs/Q/task.387.a/ term% grep -f z0 t1 | grep $t e54272690d513f8b2403568a7574b1ba /usr/arisawa/src/taskfs/Q/task.387.a/ term% grep -f z1 t1 | grep $t term% Kenji Arisawa