My file containing the following lines,
$BQ
{ VOL @home }
database daba
relation tcdeatid
opendb
clear
.lruno := 72 <-- (This line lruno. := 72 has 10 times in my file1)
.infno := 1
.tid.noel := 101
writedb
clear
.lruno := 72
.infno := 205
.tid.noel := 191
writedb
clear
$EOF
In file no.2, I want only this part mentioned below from file1.
$BQ
{ VOL @home }
database daba
relation tcdeatid
opendb
clear
.lruno := 72
.infno := 1
.tid.noel := 101
.lruno := 72
.infno := 205
.tid.noel := 191
.lruno := 72
.infno := 0
.tid.noel := 1111
.lruno := 72
.infno := 56
.tid.noel := 231
.lruno := 72
.infno := 45
.tid.noel := 61
.lruno := 72
.infno := 23
.tid.noel := 901
.lruno := 72
.infno := 123
.tid.noel := 1611
.lruno := 72
.infno := 786
.tid.noel := 81
.lruno := 72
.infno := 55
.tid.noel := 1
.lruno := 72
.infno := 253
.tid.noel := 121
writedb
clear
$EOF
I want this chunk of lines (lruno. := 72) in a another file using shell commands from file1. I want the command which will read file and count how many times has lruno. := 72 in file1 and write it down the total to another file.