Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use SU without interrupt

Status
Not open for further replies.

rexxcode

Technical User
Nov 2, 2005
4
FR
Hi.

I need to run a shell in a script after changing user/password by using su, but not 'su - <user>' but something like 'su - <user>+<password>' because a secure-certificate is built with user+password.

An idea ?

rexxcode
 
I see it but no usefull answer.

My Os is Unix System Services (Open MVS Edition), an Unix thru MVS (ZOs mainframe).
I'm calling a shell USS from a rexx MVS by using BPXBATCH but before I need to change user silently without interrupt.
The shell is bash.

I'm calling su by call bpxwunix "su - <user>"

Is su accepting an argument ?

 
Perhaps you can use Expect?
Or for something like this I would probably use the pexpect module for Python

&quot;If you always do what you've always done, you will always be where you've always been.&quot;
 
Thank you for advising pexpect.

I don't have expect with bash.
I will try to install it. Do you have a good example ?

rexxcode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top