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
  • ... Philippe Leite
    • ... Styles, Andy (CIO Enabling Services - Core Infrastructure Platform)
  • ... Farley, Peter
  • ... Sri Hari Kolusu
  • ... Radoslaw Skorupka
  • ... Paul Gilmartin
  • ... Paul Gilmartin
    • ... Radoslaw Skorupka
  • ... Paul Gilmartin
  • ... Dana Mitchell
    • ... Kirk Wolf
      • ... Tony Harminc
      • ... Radoslaw Skorupka
        • ... Kirk Wolf
      • ... Rob Schramm
  • ... Paul Gilmartin
  • ... Paul Gilmartin
  • ... Paul Gilmartin

Reply via email to