![]() |
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 Sql scripts accross db2 | jnimz | Shell Programming and Scripting | 4 | 10-23-2008 06:49 AM |
| Running scripts through cronjob. | jitu.jk | Shell Programming and Scripting | 3 | 06-23-2008 06:33 PM |
| scripts running under different users | csnewbie | UNIX for Dummies Questions & Answers | 1 | 02-14-2007 04:52 PM |
| Running scripts parallely | santho | UNIX for Dummies Questions & Answers | 4 | 07-23-2006 12:42 PM |
| Running three scripts parallelly | anwarsait | Shell Programming and Scripting | 1 | 07-18-2006 01:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Running scripts via su
Hi All,
Am using the below command to start my application using the root user su - bin -c "/home/bin/test/start.sh" but am getting the error becaue i have set some environment varibales in bin .profile when i execute the command start.sh by logging directly into bin account it's working fine But where as if i ran the above command using the root user am getting error seems it's not loading the bin profile Please advise me how to load the bin's profile while using the su |
|
||||
|
Quote:
Hi Thanks for the reply, I have the bin direcotry and when the run the start.sh script file it's running fine but when am running the start.sh using the root shell by using the su command it's not working |
|
|||||
|
When you run su as you explained, it tries to load the environment of "bin". If you want root's environment instead, use:
Code:
su bin -c start.sh |
|
||||
|
Quote:
When i run the below command i want's bin environment varibales loaded but it's not loading so my process getting failed with the the reason NoClassDefination found error su - bin -c "start.sh" |