in reply to Reading lines and matching words

Is there some reason you aren't using grep(1)?