Bash (Unix shell): Difference between revisions

Content deleted Content added
Builtin commands: Add wwwwwh questions, hidden
Commands: Add hidden lists, re wwwwwh questions, and add subsection System Commands
Line 1,926:
[ ] Speed of execution
[ ] fork(2) / exec(2)
[ ? ] type -a
-->
 
=== System commands <span class="anchor" id="System commands"></span> ===
 
<!-- What are system commands? -->
<!-- Why does Bash have system commands?-->
<!-- When should system commands be used? -->
<!-- How does one use system commands? -->
 
=== Aliases <span class="anchor" id="Aliases"></span> ===
Line 1,937 ⟶ 1,945:
[ ] alias names can be nearly anything
-->
<!-- What are aliases? -->
<!-- Why does Bash have aliases?-->
<!-- When should aliases be used? -->
<!-- How are aliases and system commands different/similar? -->
<!-- How does one use aliases? -->
 
{{Blockquote
| Aliases allow a string to be substituted for a word that is in a position in the input where it can be the first word of a simple command. Aliases have names and corresponding values that are set and unset using the alias and unalias builtin commands.
Line 1,978 ⟶ 1,992:
}}
 
=== Keywords / Reserved words Words<span class="anchor" id="Keywords / Reserved words"></span> <span class="anchor" id="Keywords"></span> <span class="anchor" id="Reserved words"></span> ===
 
<!-- Important concepts:
Line 1,985 ⟶ 1,999:
[ ] List
-->
<!-- What are Reserved Words? -->
<!-- Why does Bash have Reserved Words?-->
<!-- When should Reserved Words be used? -->
<!-- How are Reserved Words and different/similar from anything else? -->
<!-- How does one use Reserved Words? -->
 
* {{Code| function}}
** Bash function declarations which include this particular keyword are not compatible with Bourne/Korn/POSIX scripts, however, Bash does accepts the function declaration syntax used by Bourne, Korn and POSIX-compliant shells.
Line 1,998 ⟶ 2,018:
[ ] Limitations of functions
-->
<!-- What are functions? -->
<!-- Why does Bash have functions?-->
<!-- When should functions be used? -->
<!-- How are functions and aliases different/similar? -->
<!-- How does one use functions? -->
 
{{Blockquote
| Shell functions are a way to group commands for later execution using a single name for the group. They are executed just like a "regular" simple command. When the name of a shell function is used as a simple command name, the shell executes the list of commands associated with that function name. Shell functions are executed in the current shell context; there is no new process created to interpret them.
Line 2,110 ⟶ 2,136:
[x] Common practices, mutability
[ ] Internal commands
[ ? ] How Bash performs a PATH search
[x] Multiple commands with the same name
[ ? ] HowSpeed to force a PATH search - extra?considerations
[ ? ] typeHow to force -a PATH search - extra?
[ ? ] security considerations
-->
When the shell looks for external commands, it relies on the Bourne shell variable {{Code| $PATH| bash}}. {{Code| $PATH| bash}} contains a list of directories separated by colons, {{Code| :| bash}}.