3 ms·
Bash has no standard library. It has builtins, and commands. And commands are just external tools.
by oweiler 1y ago
Bash has no standard library. It has builtins, and commands. And commands are just external tools.
- queuebert 1y agoEven '[' is an external binary in /usr/bin typically.
- AStonesThrow 1y ago"Standard library" is sort of a C-specific term. "builtins" are primitives that Bash can use internally without calling fork()/exec(). In fact, builtins originated in the Bourne shell to operate on the current shell process, because they would have no effect in a subprocess or subshell. In addition to builtins and commands, Bash also defines "reserved words", which are keywords to make loops and control the flow of the script. https://www.gnu.org/software/bash/manual/bash.html#Reserved-Words https://www.gnu.org/software/bash/manual/bash.html#Reserved-... Many distros will ship a default or skeleton .bashrc which includes some useful aliases and functions. This is sort of like a "standard library", if you like having 14 different standards. https://gist.github.com/marioBonales/1637696 https://gist.github.com/marioBonales/1637696 '[' is an external binary in order to catch any shell or script that does not interpret it as a builtin operator. There may be a couple more. Under normal circumstances, it won't actually be invoked, as a Bash script would interpret '[' as the 'test' builtin.