Dagang Wei
Dagang Wei

Reputation: 26498

Is there a standard library for Bash?

Is there a standard library for Bash? something like Java standard library.

Upvotes: 8

Views: 1389

Answers (2)

alex
alex

Reputation: 929

You can try these 2 GitHub repoes, although they are not standard library, but it might be a good start.

xsh: a bash library framework.

xsh-lib/core: the core library of xsh.

Upvotes: 4

nhed
nhed

Reputation: 6001

No, I don't think there are 'standard libraries' such as STL. There are various files that you can include. For example:

  • there are bash libraries to enable command-line completion for clear-case, git, etc
  • there is /etc/init.d/functions which intended for use in /etc/init.d scripts (implementing services)
  • There is /etc/sysconfig/network-scripts/network-functions for use by scripts that are invoked when network interfaces (or whole network subsystem) change state.
  • there are modules in /etc/profile.d that are automatically included for use by interactive shells

But I don't think that there are libraries implementing containers, iterators etc.

Upvotes: 4

Related Questions