Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
irishsultan
on Jan 23, 2019
|
parent
|
context
|
favorite
| on:
For the Love of Pipes
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.
kps
on Jan 23, 2019
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: