The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-23-2009
apitambare apitambare is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 2
When you pbrun into a different account a new login script is executed because of which it waits for at the command prompt. The commands in your main script will be executed after you manually exit from this login script.
Here is how I solved the problem for myself:
1. In my main script I created a zero-length temporary file at a predetermined location (I tried exporting variables to the new login script but that does not work)
2. In the .profile of the new user account I check if this file exists and execute the required commands and delete the temporary file

thus if you pbrun to that user from the command prompt this file won't be there so your commands won't be executed.

you could have a problem though if multiple users are pbrunning into that account at the same time as you are executing your script.

Hope this helps.