News for hackers. Stuff that matters.
Re:For the Love of Pipes by irishsultan on Wednesday January 23, 2019 @09:06AM (#18978168)
That's not the same thing. The sed output will still keep lines not starting with x (just not replacing foo with bar in those) where grep will filter those out.
Re:For the Love of Pipes by kps on Wednesday January 23, 2019 @11:03AM (#18979358)
Yeah, Muphry's law at work. Corrected version:

   sed -n '/^x/s/foo/bar/gp' <input
This may be an inadvertent argument for the ‘connect simpler tools’ philosophy.