![]() |
|
|
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 07:49 AM |
| Running scripts through cronjob. | jitu.jk | Shell Programming and Scripting | 3 | 06-23-2008 07: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 01:42 PM |
| Running three scripts parallelly | anwarsait | Shell Programming and Scripting | 1 | 07-18-2006 02:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
I understood you, you said when we run the su command with "-" you are saying it's will load the bin's profile but in my case it's not loading the bin's profile it's taking the root's environment variables only |
|
||||
|
First, identify the path that bin is using for home. Then, ensure that there is a .profile for bin: Code:
ls -la /path_to_bin's_home_directory/bin Then, write this script to see how the environment is changed using the ". /path/.profile" to change your environment. Code:
#!/usr/bin/sh /usr/bin/env > /tmp/default.environmentOutput # This is where you will source the profile for your user . /path_to_bin's_home_directory/bin/.profile /usr/bin/env > /tmp/bin.environmentOutput EDIT: Run using this command: Code:
su - bin -c "/path_to_your_script/envCheck.sh" /EDIT This will create two files in /tmp The first will show you the current environment variables. The second will show you the NEW environment variables when you source the profile. Test that - if you see a difference between the two files in /tmp, then you will see what the previous poster's are recommending. If you do not, then there is likely something wrong with the profile that you are sourcing - or you may be sourcing the wrong one. Last edited by avronius; 02-11-2009 at 12:31 PM.. Reason: Changed for clarity |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|