Bash Features
Bash Startup Files
bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o option] [argument ...] bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o option] -c string [argument ...] bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o option] [argument ...]
In addition to the single-character shell command-line options (see The Set Builtin), there are several multi-character options that you can use. These options must appear on the command line before the single-character options in order for them to be recognized.
--dump-po-strings
|
Equivalent to ` |
--dump-strings
|
Equivalent to ` |
--help
|
Display a usage message on standard output and exit sucessfully. |
--login
|
Make this shell act as if it were directly invoked by login.
This is equivalent to ` |
--noediting
|
Do not use the GNU Readline library (see Command Line Editing) to read interactive command lines. |
--noprofile
|
Don't load the system-wide startup file ` |
--norc
|
Don't read the ` |
--posix
|
Change the behavior of Bash where the default operation differs from the POSIX 1003.2 standard to match the standard. This is intended to make Bash behave as a strict superset of that standard. See Bash POSIX Mode, for a description of the Bash POSIX mode. |
--rcfile filename
|
Execute commands from filename (instead of ` |
--restricted
|
Make the shell a restricted shell (see The Restricted Shell). |
--verbose
|
Equivalent to ` |
--version
|
Show version information for this instance of Bash on the standard output and exit successfully. |
There are several single-character options that may be supplied at
invocation which are not available with the set
builtin.
-c string
|
Read and execute commands from string after processing the
options, then exit. Any remaining arguments are assigned to the
positional parameters, starting with |
-i
|
Force the shell to run interactively. |
-r
|
Make the shell a restricted shell (see The Restricted Shell). |
-s
|
If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell. |
-D
|
A list of all double-quoted strings preceded by ` |
--
|
A |
An interactive shell is one whose input and output are both
connected to terminals (as determined by isatty(3)
), or one
started with the `-i
' option.
If arguments remain after option processing, and neither the
`-c
' nor the `-s
'
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (see Shell Scripts).
When Bash is invoked in this fashion, $0
is set to the name of the file, and the positional parameters
are set to the remaining arguments.
Bash reads and executes commands from this file, then exits.
Bash's exit status is the exit status of the last command executed
in the script. If no commands are executed, the exit status is 0.