Re: unix commands in batch and su

2023-06-16 Thread Jantje.
On Tue, 13 Jun 2023 16:42:05 -0500, Kirk Wolf wrote: >FYI, with Co:Z Batch instead of BPXBATCH, you just provide STDIN input to the >shell like you would from a terminal. +1[*] for Co:Z Batch Jantje. [*] Well, make that 1.000.000. It is so much better than any of the IBM ways of doing Unix

Re: unix commands in batch and su

2023-06-14 Thread Sri h Kolusu
≫ Sri, ITYM BPXPSATSL Alan, Not really. BPXBATSL is an alias of BPXBATCH. BPXBATSL provides users with an alternate entry point into BPXBATCH. It also forces a program to run by using a local spawn instead of fork/exec as BPXBATCH does. Check this link https://www.ibm.com/docs/en/zos/2.5.0?t

Re: unix commands in batch and su

2023-06-14 Thread Rick Troth
As others have said, you need to feed the list-o-commands into the interpreting shell. Another tool that should be recommended is 'sudo'. But I'll defer commentary on that just now for sake of brevity. Don't fear "scripting". The input to 'sh' or to 'su' can be from a USS file, but it can al

Re: unix commands in batch and su

2023-06-14 Thread Allan Staller
Classification: Confidential Sri, ITYM BPXPSATSL -Original Message- From: IBM Mainframe Discussion List On Behalf Of Sri h Kolusu Sent: Tuesday, June 13, 2023 2:26 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: unix commands in batch and su [CAUTION: This Email is from outside the

Re: unix commands in batch and su

2023-06-14 Thread Radoslaw Skorupka
W dniu 13.06.2023 o 23:42, Kirk Wolf pisze: FYI, with Co:Z Batch instead of BPXBATCH, you just provide STDIN input to the shell like you would from a terminal. //SU EXEC PGM=COZBATCH //STDIN DD * su -s omvskern # commands for the su shell ... whoami exit # quit the su shell whoami # back

Re: unix commands in batch and su

2023-06-13 Thread Kirk Wolf
FYI, with Co:Z Batch instead of BPXBATCH, you just provide STDIN input to the shell like you would from a terminal. //SU EXEC PGM=COZBATCH //STDIN DD * su -s omvskern # commands for the su shell ... whoami exit # quit the su shell whoami # back to my login shell // Which prints: OMVS

Re: unix commands in batch and su

2023-06-13 Thread Radoslaw Skorupka
W dniu 13.06.2023 o 22:56, Kurt J. Quackenbush pisze: I put 'su' command before others, but it doesn't work. Try piping the commands to su, like this: //STEP EXEC PGM=BPXBATCH //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //STDPARM DD * SH ; echo "The mkdir a command runs as the job's userid"; mk

Re: unix commands in batch and su

2023-06-13 Thread Kurt J. Quackenbush
> I put 'su' command before others, but it doesn't work. Try piping the commands to su, like this: //STEP EXEC PGM=BPXBATCH //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //STDPARM DD * SH ; echo "The mkdir a command runs as the job's userid"; mkdir a; echo "The mkdir b command runs as superuser, if

Re: unix commands in batch and su

2023-06-13 Thread Andy Styles
The way I've done it is to 'echo' the commands together as one long string, and then pipe that to su: //RUNEXEC PGM=BPXBATCH //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //STDIN DD DUMMY //STDPARM DD * SH echo 'echo "Starting" ; cd / ; ls -la ; id ; echo "Ending" ' | su Note th

Re: unix commands in batch and su

2023-06-13 Thread Radoslaw Skorupka
W dniu 13.06.2023 o 21:26, Sri h Kolusu pisze: I put 'su' command before others, but it doesn't work. Radoslaw, Try using BPXBATCH //STEP0100 EXEC PGM=BPXBATCH,REGION=8M //STDOUT DD SYSOUT=*, //LRECL=133,RECFM=FB,DSORG=PS,BLKSIZE=0 //STDERR DD SYSOUT=* //STDPARM DD * SH su;

Re: unix commands in batch and su

2023-06-13 Thread Sri h Kolusu
>> I'd use RECFM=VB and longer LRECL. 133? Is there a common 133 column >> printer or 327x model? Gil, Agreed on the usage of VB and longer LRECL. However, the JCL is a stripped version for ls command, and I wanted the LRECL to be FB for parsing out the contents later. Thanks, Kolusu -

Re: unix commands in batch and su

2023-06-13 Thread Paul Gilmartin
On Tue, 13 Jun 2023 19:26:14 +, Sri h Kolusu wrote: >>> I put 'su' command before others, but it doesn't work. >Radoslaw, > >Try using BPXBATCH > An alternative is bpxwunix(). o Advantage: it supports line comments in STDIN. o Drawback: requires a REXX wrapper. But that can be instream. >//

Re: unix commands in batch and su

2023-06-13 Thread Pew, Curtis G
On Jun 13, 2023, at 2:07 PM, Radoslaw Skorupka <0471ebeac275-dmarc-requ...@listserv.ua.edu> wrote: Any clue how to use su and the commands? I would like to avoid putting all the commands to the shell script, as that require puting the s

Re: unix commands in batch and su

2023-06-13 Thread Sri h Kolusu
>> I put 'su' command before others, but it doesn't work. Radoslaw, Try using BPXBATCH //STEP0100 EXEC PGM=BPXBATCH,REGION=8M //STDOUT DD SYSOUT=*, //LRECL=133,RECFM=FB,DSORG=PS,BLKSIZE=0 //STDERR DD SYSOUT=* //STDPARM DD * SH su; echo $PATH; your other commands; Thanks,

unix commands in batch and su

2023-06-13 Thread Radoslaw Skorupka
I need to issue several commands in batch, that means JCL job. I know some ways to do it, but... but before I have to issue su command to get root authorities. I put 'su' command before others, but it doesn't work. Example: //K EXEC PGM=IKJEFT01 //SYSTSIN DD *  oshell su;mkdir a;mkdir b;other co