TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Simple multiline find and replace with sed

14 pointsby cwafflesabout 5 years ago

2 comments

cwafflesabout 5 years ago
Hi HN,<p>I&#x27;ve made a website for generating sed scripts with Rust and Typescript+React. Built this in a week to learn Rust with GraphQL and Diesel, and a bit of front end with React. Feedback is much appreciated.<p>Github: <a href="https:&#x2F;&#x2F;github.com&#x2F;esemeniuc&#x2F;replace.sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;esemeniuc&#x2F;replace.sh&#x2F;</a>
评论 #22787061 未加载
level3about 5 years ago
It looks like you&#x27;re not escaping single quotes in the find pattern, so the command output gets malformed.<p>Also, you&#x27;re reading in the whole file before replacing, even though most uses of sed will probably be per line. Including an option for line-by-line (maybe as default) would be much better for large files.