![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running script from other user rather than login user | rawatds | Shell Programming and Scripting | 3 | 01-30-2009 01:18 PM |
| run a script on logout by a non-root user | harsha10 | Shell Programming and Scripting | 6 | 06-16-2008 03:14 PM |
| CDE login Problem for root user only | Awadhesh | HP-UX | 1 | 08-02-2005 08:58 AM |
| Running a command or script as root | rm-r | Shell Programming and Scripting | 3 | 05-27-2005 08:58 AM |
| root executes a script as another user | tads98 | Shell Programming and Scripting | 1 | 05-17-2005 08:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
As root , running script as different user with su - problem
Dear All
I am running into a situation where I am running a script as another user lets say oracle using su command as below, and the script fails because the .profile of oracle is not executed so the environment variables are not set. cat /etc/passwd | grep oracle oracle:!:400:101::/app/oracle:/usr/local/bin/bash Now, I logegd in as root and did this : su - oracle -c test.sh test.sh is #!/bin/sh echo "I am here" env The output has hello from the echo command but the env does not show any ORACLE variables from .profile of oracle user or even from .bash_profile. I alos verified by adding a simple sqlplus block , it failes with sqlplus not found due to missing environment variables. Any ideas ? Thanks in advance ! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|