idk who downvoted you, it’s a very common sentiment. I advocate for <<<, but a pipe is often fine when performance doesn’t matter.
Badabinski
Alt account of @Badabinski
Just a sweaty nerd interested in software, home automation, emotional issues, and polite discourse about all of the above.
- 0 Posts
- 5 Comments
Joined 2 years ago
Cake day: June 9th, 2024
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Idk, writing POSIX-compliant shell is so miserable that I avoid doing it when I can. You can use Bash on BSD and all other unixes, so it’s still a relatively portable solution.
I was waiting for someone to come along with this response lmao
I’m terrible at remembering shell string operation syntax, but this is the ultimate answer.
no pipe necessary, just
sed -E 's/TH|[EL ]|DO//g' <<<"$line"


Yeah, plus it has type hints and tooling to make said type hints mandatory.
Also, like, fuck golang, it’s such a shit language and the compiler does very little to protect you. I’d say that mypy does a better job of giving you AOT protection.