The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-24-2006
piooooter piooooter is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 24
[AIX] executing script

Hello!

I need to run a script from the root user as the other user. I know that I can issue the following command:
su - user_name -c "/path_to_script/script_name.sh"

But there is a small problem with the above command. I must export a environment variable before I run the script. In the other case, the script won't work properly. How can I export the variable and execute the script using su - user_name -c ....? Maybe any other ideas? I must add, that there is no possibility to modify script_name.sh file.

Thanks for help!
Pit

Last edited by piooooter; 05-24-2006 at 05:57 PM..