X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/5b8bb72c57895aae90de0b4231a2a7c379422f0e..f72fc7825c9549da272ef976d906d7054b59545b:/packages/bash/etc-profile diff --git a/packages/bash/etc-profile b/packages/bash/etc-profile index 6328df44..3adab248 100644 --- a/packages/bash/etc-profile +++ b/packages/bash/etc-profile @@ -1,8 +1,15 @@ -if [ -d @TERMUX_PREFIX@/etc/profile.d ]; then - for i in @TERMUX_PREFIX@/etc/profile.d/*.sh; do - if [ -r $i ]; then - . $i +# Source etc/bash.bashrc also for interactive bash login shells: +if [ "$BASH" ]; then + if [[ "$-" == *"i"* ]]; then + if [ -r @TERMUX_PREFIX@/etc/bash.bashrc ]; then + . @TERMUX_PREFIX@/etc/bash.bashrc fi - done - unset i + fi fi + +for i in @TERMUX_PREFIX@/etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi +done +unset i