Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,957
    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!

  3. #3
    Just 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?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2008
    Posts
    28

    someone can help on that?

    remember that the user root have this problem.

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,957
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •