Hi,
the manpage states:
When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist. […] The --rcfile file option will force bash to
read and execute commands from file instead of /etc/bash.bashrc and
~/.bashrc.
This wording suggests (or may suggest) that `bash --rcfile foo` will
execute file `foo`, and complain if it contains an error or if it does
not exists.
Instead, `bash --rcfile foo` will happily carry on if `foo` does not
exist, probably applying the same logic used for `~/.bashrc`.
https://bugs.debian.org/1042394 reports that this happen for
`--init-file` as well.
Should the manpage be reworded to avoid stating "will force bash to
read..."? Or should passing a non existing file to `--rcfile` turned
into an error?
Regards,
--
Gioele Barabucci