Hacker News new | ask | show | jobs
by cbm-vic-20 84 days ago
fd:find::rg:grep

Someone please make an awesome new sed and awk.

3 comments

sd exists, dunno but awk.

https://github.com/chmln/sd

How is GNU / BSD sed and awk not awesome?
Limited regex capabilities. A fast tool that does what sed and awk do with PCRE2 would be amazing.
IIRC the GNU sed people looked into adding pcre support but decided it was too much work and that people should just use perl instead.
Well, I would like to tackle that but unfortunately I do not have enough time to do things for free. :(

Is there any demand for it anyway?

I think there would be, but I can only raise my own hand :-)

A tool called sd exists that's close enough for sed, but I haven't seen anything similar for awk.

I took a minute to think about it. It would be much more work to add it to awk. :( And replacing every regex evaluation could slow scripts significantly, although this could be a good challenge! :D

Are you using "sd" or is there anything wrong with it as a replacement of sed?

I'm using sd and am reasonably happy with it. Its only downsides are not quite being PCRE and not having the same syntax as sed, so it needs retraining and to be extra sure that it stays available in the places it's needed. The best part about sed is that it can generally be found in any *nix system.

I totally get that PCRE is a massive beast and might not be worth the effort. I would gladly settle for a smaller engine that can handle lookahead and lookback. Yeah, they're expensive, but they're powerful and convenient enough for me to still reach for them when I can.

Thanks for the consideration :-)

Have you heard of fastmod?