Open-source Languages & Tools for z/OS

 View Only
  • 1.  Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-20-2023 09:35

    We have been using bash GNU bash, version 4.3.46(51)-release (i370-ibm-openedition) which is pretty old.

    Just updated to all the new Opensource Rocket tools and the new bash (5.1.0) does not call the .bashrc (or bashrc) anymore.

    Switch back to the old version (4.3.46) and it works fine with no other changes.

    Any ideas on why I am having this issue?

    Potential solutions?
    Thanks

    Mark Shackelford



    ------------------------------
    Mark Shackelford
    Systems Programmer
    Dynatrace
    Detroit MS US
    ------------------------------


  • 2.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    ROCKETEER
    Posted 01-20-2023 09:49
    Edited by Alexander Klochkov 01-20-2023 09:56

    Hi Mark Shackelford,

    If bash is an interactive login shell it's expected behavior. You need to use ~/.bash_profile for this purpose.

    You can simply use these lines for ~/.bash_profile

    if [ -f ~/.bashrc ]; then
    	. ~/.bashrc
    fi

    Some details:
    https://linuxize.com/post/bashrc-vs-bash-profile/
    https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Bash-Startup-Files


    Thanks,
    Alexander



    ------------------------------
    Alexander Klochkov
    QA
    Rocket Internal - All Brands
    Vilnius LT
    ------------------------------



  • 3.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-23-2023 07:10

    Interfactively, bash invokes .profile.

    Non interactive which is where I am having the problem, it does not invoke .profile or .bashrc or bash_profile or bash_login.  Tried them all

    5.1 does not work, the old 4.3 works everytime with no other changes.

    5.1 seems to be broke.



    ------------------------------
    Mark Shackelford
    Systems Programmer
    Dynatrace
    Detroit MS US
    ------------------------------



  • 4.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-24-2023 09:21
    Hi Mark,
    I have compared Bash 4.3 and Bash 5 behavior on z/OS and Linux. Only Bash 4.3 for z/OS invokes .bashrc in non-interactive mode and it seems like Bash 4.3 on Linux too, however Bash 5 on both platforms doesn't .bashrc. This behavior is in accordance with the documentation, therefore we don't consider that Bash 5 on z/OS has a bug.

    ------------------------------
    Tatiana Balaburkina
    Engineering Manager
    Rocket Internal - All Brands
    ------------------------------



  • 5.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-26-2023 08:25
    Ok, working as designed. ☹

    How do I get the PATH set if no profiles get invoked?
    That just doesn’t seem right.

    Mark




  • 6.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    ROCKETEER
    Posted 01-26-2023 16:08

    HI Mark Shackelford,

    Is this not your case?
    https://superuser.com/questions/306530/run-remote-ssh-command-with-full-login-shell

    Thanks,

    Alex



    ------------------------------
    Alexander Klochkov
    QA
    Rocket Internal - All Brands
    Vilnius LT
    ------------------------------



  • 7.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-27-2023 07:36
    I have tried every combination and permutation of the commands on this page and none of them work.
    With the -l or -t options, it just puts me into a terminal session.
    I just want a good $PATH and execute the command that I send it and return

    None of these do that.

    Mark




  • 8.  RE: Newest Bash (GNU bash, version 5.1.0(1)-release (s390x-ibm-zos-gnu) does not call bashrc

    Posted 01-27-2023 15:01
    I have figured out how to make it work.
    You have to set the “~/.ssh/environment variable to have the correct PATH’

    It works now.

    Thanks for pointing me in the right direction.

    Mark