If you understand how UNIX works, this is quite sensible. See how the ISPF 
interface to USS works.

-
-teD
-
  Original Message  
From: Alan Young
Sent: Tuesday, December 29, 2015 12:13
To: IBM-MAIN@LISTSERV.UA.EDU
Reply To: IBM Mainframe Discussion List
Subject: Re: BPXBATCH "SH ...; su; pax ..." does not do what you think it does

Peter Hunkeler wrote:
> 
> 
> To run commands in a "su" shell environment, you have to write all the 
> commands into a UNIX file first, and then call "su" by redirecting stdin to 
> that UNIX file.
>
>
> echo "id" > /tmp/sucommandfile
> su < /tmp/sucommandfile
>
> 

The manual has examples of executing commands via su without redirection 
like this:

To run the /usr/lib/backupall script under the admin user ID and return 
to the parent shell environment when the script completes:

|su admin /usr/lib/backupall|

To run a remove shell command under the admin user ID and return to the 
parent shell environment when the command completes:

|su admin -c "rm -rf /tmp/"


|

Alan

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to