In any case, if you have one step that writes to a Unix file and then the second step executes the contents with "su", you need to be (as Elmer Fudd would say) VEWY VEWY CAREFUL ;-)
Kirk Wolf Dovetailed Technologies https://coztoolkit.com //SUSHELL EXEC PGM=COZBATCH Friends don't let friends use BPXBATCH //STDIN DD * su <<EOD cmd1.. cmd2.. EOD // On Thu, Aug 27, 2026, at 3:01 PM, Radoslaw Skorupka wrote: > Actually there is missing DISP=DELETE for unix files > Of course another solution for the conflicting names would be to use > home directory, not /tmp. > > -- > Radoslaw Skorupka > Lodz, Poland > > > > > W dniu 27.08.2026 o 16:46, Kirk Wolf pisze: > > Hmm, what happens if another user does the following before your run your > > job and before /tmp/cmd.txt is created? > > > >> cd /tmp > >> echo "rm -rf /" > cmd.txt > >> chmod 644 cmd.txt > > PS> BPXBATCH sucks. > > > > Kirk Wolf > > Dovetailed Technologies > > https://coztoolkit.com > > > > On Wed, Aug 26, 2026, at 6:38 PM, Dana Mitchell wrote: > >> If you put the commands in a unix file, you can feed them into bpxbatch/su > >> via STDIN: > >> > >> //*-----------------------------------------------------------------*/ > >> //* Copy command to uss file > >> //*-----------------------------------------------------------------*/ > >> //OCOPY1 EXEC PGM=IKJEFT01 > >> //SYSTSPRT DD SYSOUT=* > >> //FILE DD PATH='/tmp/cmd.txt', > >> // PATHOPTS=(OWRONLY,OCREAT), > >> // PATHMODE=(SIRWXU,SIRGRP) > >> //SYMOUT DD SYSOUT=* > >> //CARDS DD *,SYMBOLS=(EXECSYS,SYMOUT) > >> cd /u/zzzz/ibm/zzz-3_1_1-20260810 > >> pax -ppx -rvzf zzzz-3.1.1-zzzzz-20260810.pax.Z > >> /* > >> //SYSTSIN DD * > >> OCOPY + > >> INDD(CARDS) + > >> OUTDD(FILE) + > >> TEXT + > >> PATHOPTS(OVERRIDE) > >> /* > >> //*-----------------------------------------------------------------*/ > >> //* Issue command under su > >> //*-----------------------------------------------------------------*/ > >> //UNMOUNT EXEC PGM=BPXBATCH, > >> // PARM='SH su' > >> //STDIN DD PATH='/tmp/cmd.txt',PATHOPTS=(ORDONLY) > >> //STDOUT DD SYSOUT=* > >> //STDERR DD SYSOUT=* > >> //*-----------------------------------------------------------------*/ > >> > >> ---------------------------------------------------------------------- > >> For IBM-MAIN subscribe / signoff / archive access instructions, > >> send email to [email protected] with the message: INFO IBM-MAIN > >> > > ---------------------------------------------------------------------- > > For IBM-MAIN subscribe / signoff / archive access instructions, > > send email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
