#1042394 Bash does complain of a missing file fiven for options: --rcfile or --init-file

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Rui Damas
Date:
2023-07-27 15:36:03 UTC
Severity:
normal
Tags:
#1042394#5
Date:
2023-07-27 13:00:38 UTC
From:
To:
problem: when using the option --rcfile or --init-file, no matter
weather the file path given is valid or not... it will load the file
if is present... :) ... and will just ignore the file (and without
loading the default ~/.bashrc)... :( ... while i expected it to exit
with an error and saying like ::: given rcfile 'non/existing/file' not
found.

my current work around: make a wrapper that checks for the file existence... :(

While in the manual says nothing about this being supposed to
happen... it just says:

"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.  This may be inhibited by using the --norc option.
The --rcfile file option will force bash to read and execute commands
from file instead of /etc/bash.bashrc and ~/.bashrc."

Thoughts on this...

O.o ... as bash (with no --rcfile) ignores ~/.bashrc if it does not
exist... :) ... maybe is supposed to behave like that... though
strange, since the it is being specified.

.. but if that is the case, then i would suggest that with --rcfile
behaves as it does now... but with --init-file (that now behaves as
--rc-file) would make the check for it's file (argument) existence.

[ bom dia ], r

#1042394#10
Date:
2023-07-27 15:33:32 UTC
From:
To:
Just noticed...

The subject of this bug is supposed to be:

  Bash does NOT complain of a missing file given for options: --rcfile
or --init-file

& sorry about that...