z/OS Tools & Language

Use of config file by bash

  • 1.  Use of config file by bash

    Posted 04-29-2019 08:29

    I’ve just installed GNU bash, version 4.2.53(1)-release (i370-ibm-openedition) on Z/OS 2.3 and I’m somewhat confused by what config files bash uses at startup

    From …//share/doc/bash/4.3/README.ZOS the doc sartes
    Non-interactive mode
    The bash shell proceses configuration files in the following order:
    (1) /etc/bash.bashrc
    (2) ~/.bashrc

    Login-shell
    The bash login shell processes configuration files in the following order:
    (1) ~/.bash_profile
    (2) ~/.bash_login
    (3) ~/.profile

    Non-login shell
    The bash shell executes a file “~/.bashrc”

    The results for a non-login shell matches the doc

    However I do a:
    bash echo.sh
    (which I assume is a non-interactive shell) I see no config files executed

    If I try
    bash --login
    I onle see the follwoingt cofig file excured
    /etc/profile
    ~/…bash_profile