| created on | June 13, 2026 |
Interactive shell:
or
For interactive shells is set .It is not set for non-interactive shells. For interactive shells the special var contains ‘i’.
To test within a script whether a shell is interactive:
or
On startup, Bash looks for the following files, in the order given below, and for those files that exist, and executes the commands in those files:
The option inhibits this behaviour.
Usually contains code to execute commands in as well:
a shorter form of this is
When Bash as an interactive login shell terminates, it looks for and executes the commands in therein.
On startup, Bash executes commands from ~/.bashrc, if that file exists. The option inhibits this behavior. The file option causes Bash to use file instead of .
Shells also provide a small set of built-in commands (built-ins). Some functionality is impossible or inconvenient to obtain via commands that are not built-in (built into the shell). For example, cd, break, continue, and exec directly manipulate the shell itself, which an external commands obviously cannot.
history, getopts, kill, or pwd built-ins could be implemented in separate commands, but they are more convenient to use as built-in commands.