Is there a standard library for Bash?
Is there a standard library for Bash?开发者_开发问答 something like Java standard library.
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.
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.
精彩评论