We have the 4.2.53 version of bash and are having problems with BPXBATCH when using the exec command.
GNU bash, version 4.2.53(2)-release (i370-ibm-openedition)
Copyright © 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
If the last line of my .profile contains an exec for the bash shell
When running a batch TMP with BPXBATCH it produces no output. (ie appears to run but just returns the READY prompt).
This is what I ran
//ADDIT EXEC PGM=IKJEFT01,REGION=0M,TIME=1440
//SYSTSPRT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSTSIN DD *
BPXBATCH SH ls -la
Same results for PGM=BPXBATCH,PARM=(‘SH ls -la’)
This is what is in my .profile
My guess is that you get no output because STDOUT and STDERR are not Unix kernal fds, and so they do not survive the exec. If instead you use PATH=/tmp/my_stderr, along with the two other keywords, to send the output to a USS file, and then add a second step to copy the results to the spool, it should work. You may need to second step to use BPXBATSL with PGM /bin/cp to ensure that the sysout DDs are available when they are needed. Or you can do it in one step (at least in this case), by using PGM /bin/ls along with BPXBATSL.
I think it’s the fact that I am using exec in my profile if I change that to /sysn/rs/bin/bash (ie remove the exec it works)
I am using the exec so it don’t have to exit twice.
In your ~/.profile do:
exec /sysn/rs/bin/bash -l