top | item 45010188

(no title)

abathur | 6 months ago

When you say library system, do you mean something more or less like a separate search path and tools for managing it?

I've written a little about how we can more or less accomplish something like meaningfully-reusable shell libraries in the nix ecosystem. I think https://www.t-ravis.com/post/shell/the_missing_comprehensive... lays out the general idea but you can also pick through how my bashrc integrates libraries/modules (https://github.com/abathur/bashrc.nix).

(I'm just dropping these in bin, since that works with existing search path for source. Not ideal, but the generally explicit nature of dependencies in nix minimizes how much things can leak where they aren't meant to go.)

discuss

order

matheusmoreira|6 months ago

> do you mean something more or less like a separate search path

Exactly. I sent to the GNU Bash mailing list patches that implement literally this. It worked like this:

  # searches for the `some-module` file
  # in some separate PATH just for libraries
  # for example: ~/.local/share/bash/modules

  source -l some-module
At some point someone said this was a schizophrenic idea and I just left. Patches are still on the mailing list. I have no idea what the maintainer did with them.

abathur|6 months ago

It seems reasonable to me. Sorry you got that reaction. Just from the mailing list thread size alone, it looks like you put quite a lot of work into it.

I wasn't readily able to find where the discussion broke down, but I see that there's a -p <path> flag in bash 5.3.