Live data from Hacker News

Bash-lib: Library for bash utility methods and tools

github.com

11–20 of 25 posts

Re: Bash-lib: Library for bash utility methods and tools

#11
post #2

We need a Bash package manager and global repo now! (If you had told me in 2001 that Javascript would have had NPM and bash not, I would not have believed you.)

Funny you asked, build2[1] can be (and is[2]) used to package bash. It even has build system support for modularization of bash scrips[3].

[1] https://build2.org

[2] https://cppget.org/?packages=bash

[3] https://build2.org/build2/doc/build2-build-system-manual.xht...

Re: Bash-lib: Library for bash utility methods and tools

#13
post #2

We need a Bash package manager and global repo now! (If you had told me in 2001 that Javascript would have had NPM and bash not, I would not have believed you.)

If you can afford using a package manager then you can afford using something more sophisticated than bash. The whole point of bash is that it’s ubiquitous: be it an air-gapped embedded system, a recovery image or a full desktop environment, you can count on it having either bash or something reasonably close, no strings attached. Introducing a Rube Goldberg package manager would go against this.

What is “reasonably close”?

Bash isn’t necessarily gonna be installed on a bsd system and it’s not exactly recent on macOS - it’s possible it’ll be dropped there too.

I’m not saying don’t write shell, I’m saying don’t assume bash specifically is available.

There’s only one bash, but there’s plenty of shells that implement POSIX “sh”.

Re: Bash-lib: Library for bash utility methods and tools

#14
post #2

We need a Bash package manager and global repo now! (If you had told me in 2001 that Javascript would have had NPM and bash not, I would not have believed you.)

At my company, for what we deploy as Bash, we take care to write it according to regular software engineering standards (code + tests + doc), build OS-specific packages, distribute them using proper repos (rpm, deb) and bake them into vm machine images/containers where needed. We declare dependencies between packages to specify (versioned) dependencies between different code libraries. Works for us.

Looking at how e.g. some official AWS code is written and distributed in shell (like ec2-instance-connect-config), that's not too far I guess from how even big orgs handle Bash code.

Re: Bash-lib: Library for bash utility methods and tools

#16
post #14
post #2

We need a Bash package manager and global repo now! (If you had told me in 2001 that Javascript would have had NPM and bash not, I would not have believed you.)

At my company, for what we deploy as Bash, we take care to write it according to regular software engineering standards (code + tests + doc), build OS-specific packages, distribute them using proper repos (rpm, deb) and bake them into vm machine images/containers where needed. We declare dependencies between packages to specify (versioned) dependencies between different code libraries. Works for us. Looking at how e.…

Did this precisely at my previous company doing platform automation. It works but requires upkeep.
Post reply on HN