3 ms·
Shameless plug for even terser syntax: https://github.com/chmln/sd https://github.com/chmln/sd
by chmln 8y ago
Shameless plug for even terser syntax: https://github.com/chmln/sd https://github.com/chmln/sd
- asicsp 8y agolooks interesting, bookmarked (will possibly add tutorial on this someday) one question though, sed is not just search and replace, it is filter + search and replace (without going into arcane commands like n,N,x,h,etc) - filtering can be done based on regex, line number, combination of these two for blocks of line, etc.. Does sd support these?
- chmln 8y agoNot to derail this submission, but thanks for the consideration! See the first sentence at https://github.com/chmln/sd#comparison-to-sed https://github.com/chmln/sd#comparison-to-sed tl;dr its only find & replace with smart defaults and easy, straightforward syntax because I hated wrangling with sed's quirks. For more features, you're better off with sed. But if you're like me and only really use sed for find/replace, you will have a good time with sd.
- asicsp 8y agooh ok, I missed that line ;) this is like 'tr' in syntax and simplicity, instead of character change, you have character-sequence change and regex has more features than sed grep already has equivalent ripgrep implemented in Rust, I think soon we will have holy trinity grep/sed/awk equivalents in Rust
- airstrike 8y agoWow, that's glorious. Thanks for sharing
- bloopernova 8y agoThat looks very nice, thank you for sharing/writing it! Are you responsible for updating the Cargo package? It's the first time I've used Cargo and was wondering how often I should re-run it or check for updates?
- chmln 8y agoYou can run cargo install-update -a every now and then to check for updates. At some point in a few weeks I hope to have binaries distributed with every release, which means there will be better/faster ways to install sd than cargo.
- choicenotchance 8y agoWhy is it 11x faster?