searching and printing result done
core dump when pattern on last line solved