Results 1 to 5 of 5
The --login flag should be load also the ~/.bash_profile (see man on bash).
BUT the problem is that when using this bash –login -c command on RC scripts then it ...
- 08-25-2010 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 28
bash --login BUG !!! ( in RC scripts )
The --login flag should be load also the ~/.bash_profile (see man on bash).
BUT the problem is that when using this bash –login -c command on RC scripts then it is not load the ~/.bash_profile !!!!@!@@!@
Anyone know why only in RC scripts it's not behave good?
Thanks
- 08-26-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
What .bash_profile is run depends upon the user id that the script is running under. ~ == user's home directory. If you need a particular profile script loaded in an rc file, then source it directly in the script.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-26-2010 #3Just Joined!
- Join Date
- Jan 2008
- Posts
- 28
Using root as the user but...
The root is the user that run the rc scripts, and user root have ~/.bash_profile.
But still the command bash --login -c 'command' will not load the ~/.bash_profile of the root only if you do it from the RC scripts.
this is the strange issue that I encounter.
Do you know why its happened?
- 10-26-2010 #4Just Joined!
- Join Date
- Jan 2008
- Posts
- 28
someone can help on that?
remember that the user root have this problem.
- 10-26-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
That's probably because when the scripts are running, the system is still booting up and not ready for logins yet. As I said, you have to source the scripts directly. Don't try to run bash --login -c <command>
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote