Merge grep and sed with sed -n .../p