3 ms·
There's some quite impressive and interesting bash (and other shell) exploration in the matrix.org "Fun Shell Scripting" room from time to time; usually when so
by iam-TJ 2y ago
There's some quite impressive and interesting bash (and other shell) exploration in the matrix.org "Fun Shell Scripting" room from time to time; usually when someone asks an obscure question and a few people dive down a rabbit-hole.
One oft overlooked feature is bash supports dynamically loadable 'builtins' as shared object modules so it wouldn't take much to create a 'proper' wrapper around libncurses.
Debian and derivatives have the package "bash-builtins" that has a lot of examples including wrapping/implementing many coreutils tools.
- abathur 2y agoA good example for lulz is https://github.com/zevweiss/booze https://github.com/zevweiss/booze, a FUSE binding for bash. Aside: I've wondered aloud if we could figure out how to systemically compile coreutils into true bash builtins for performance benefits in nix builds, but someone did rightly point out that builtins can't be completely fungible with a separate process in all cases, especially where stuff like pipelines are involved. I don't recall the exact details and couldn't readily find the conversation but IIRC it had to do with signal handling. Edit: Found the conversation: https://gist.github.com/abathur/74e7a63b25b7bbd4a6fa9ad7e728ab70 https://gist.github.com/abathur/74e7a63b25b7bbd4a6fa9ad7e728...
- lelanthran 2y ago> One oft overlooked feature is bash supports dynamically loadable 'builtins' as shared object modules 2+ decades of daily bash usage, and TIL... Any good (short) reads on how ones does this? I can think of a few things that I'd like native in the shell.
- iam-TJ 2y agoIt's all in the code - many simple examples to get started https://git.savannah.gnu.org/cgit/bash.git/tree/examples/loadables https://git.savannah.gnu.org/cgit/bash.git/tree/examples/loa...