I find that the default shell that I use when I start Terminal (with Ctrl+Alt+T) is /bin/bash
.
And running the built-in command type
on bash
as:
type -p bash
returns the result as:
/bin/bash
Suggesting the same executable is run when I do Ctrl+Alt+T or say bash
.
This shell is the same as an invocation of the command bash
with some of its options passed to it right? If yes, what are these options?
As an example, perhaps the -i
option gets passed so as to make the bash shell interactive?
PS: Maybe this is related too, but I cannot seem to piece together all the pieces here.
Best Answer
Usually, no, the terminal does not pass any options to
bash
.bash
does, however, assume a set of default options depending on how it was invoked. Fromman bash
, sectionINVOCATION
:An interactive shell further activates other options. Further some defaults apply based on the invocation name (
sh
vsbash
). Reading on (section onset
):Combined, simply invoking
bash
on a terminal will enable these options.You can confirm this by checking the value of the
$-
special variable:An additional option that maybe set is if your terminal is set to start login shells. In that case
-l
is explicitly passed by the terminal as an option.