

It was obvious and I was being a bit of a dummy this morning. Mea culpa.
Alt account of @Badabinski
Just a sweaty nerd interested in software, home automation, emotional issues, and polite discourse about all of the above.


It was obvious and I was being a bit of a dummy this morning. Mea culpa.


If you want a free and massive performance optimization, remove the cat:
fastWikiLookup() { grep "$@" ~/wikipedia.txt }
Reading and piping 156 GB of data to another process every time you want to look something up is a somewhat nontrivial action. Grep can directly read the file, which should result in a pretty damn good speed up.
Hell, Bash provides filesystem-based sockets in /dev/tcp, so a tcp connection can almost be like Unix sockets or anything else.
I always found it weird that it was specifically provided by Bash…
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.
idk who downvoted you, it’s a very common sentiment. I advocate for <<<, but a pipe is often fine when performance doesn’t matter.
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"
I’m not using it because it would be extremely inconvenient for me, but I think that the English language deserves to have the thorn returned to it.
Yeah, I was being pretty thick earlier today. Oopsie!