A shell builtin is a command called from a shell, that is executed directly in the shell itself.
13
votes
5answers
730 views
What purpose does the colon builtin serve?
I've hacked on a lot of shell scripts, and sometimes the simplest things baffle me. Today I ran across a script that made extensive use of the : (colon) bash builtin.
The documenation seems simple ...
26
votes
4answers
2k views
What is the difference between a builtin command and one that is not?
Is there any intrinsic difference between a builtin command and another command which can nominally do the same thing?
eg. Do builtins get "special" treatement? ... is there less overhead running ...
10
votes
2answers
638 views
Can I get individual man pages for the bash builtin commands?
Is there anywhere you can download a manpage for every builtin commands?
I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man ...
3
votes
2answers
653 views
Capture multi-line output of a bash builtin
Normally, bash is able to assign multi-line output of a command:
L=`ls`
This works from both interactive shell and scripts. But it appears the output of a builtin can't be captured in a variable:
...
4
votes
1answer
189 views
Why are parameters to Bash's builtin optional?
Running simply builtin prints nothing and returns exit code 0. This is in accordance with help builtin, which shows all parameters as optional. But why isn't this no-op an error? Is there a use case ...