i need to write a shell script to find the content of one file[all the content of this file] into another file along side it displays the line number and total number of occurrence of the content as an output .
#!/bin/ksh
file="/home/ashish/contents.txt"
while read -r line;
do
grep $line /home/ashish/first.csv
done < "$file"
for example : first file contain this code "at java.lang.Object.wait(Native Method) - waiting on <0x272d5c18> (a weblogic.rjvm.ResponseImpl) at weblogic.rjvm.ResponseImpl.waitForData(ResponseImpl.java:76) - locked <0x272d5c18> (a weblogic.rjvm.ResponseImpl) " second file contain code in bulk amount so i need to count the number of occurrence of code in the first file inside second file Output=number of times code in first file occur in second file along with line numbers (if possible).