Use loop instead of grep for further modification (ref gh-6).