Check in dot.bash_profile interfere with exit status ($?)
Description:
If the file (~/.bashrc) doesn't exist, the evaluation gives back 1. Because this outcome is not handled, the value will be passed as last exit status ($?).
Consequently, any primary prompt (PS1) that refers to $? will display wrong value the first time, i.e., when the shell starts.
I strongly suggest correcting the file as follows:
[[ -f ~/.bashrc ]] && . ~/.bashrc
replace to
[[ -f ~/.bashrc ]] && . ~/.bashrc || :
Additional info:
This issue has existed since the dot.bash_profile file added to package
Steps to reproduce:
Add the following (example) to the end of /etc/bash.bashrc
PS1="\$?"