Results 1 to 5 of 5

Thread: use of source command in .bashrc

  1. #1
    Join Date
    Jul 2011
    Beans
    1
    Distro
    Ubuntu 10.04 Lucid Lynx

    use of source command in .bashrc

    Hi guys

    I am doing some computational stuff using intel compiler and
    open foam (CFD)

    Following Intel instructions, I added the following line at the
    end of the .bashrc :

    source /opt/intel/composerxe-2011.4.191/bin/compilervars.sh ia32

    compiler is working properly (i.e. using icc command from the command line)

    Recently, I have installed open foam program, which require the following line at the end of the .bashrc :

    source /opt/openfoam210/etc/bashrc

    Problem is that now the icc command does not work any more (Open Foam does).

    The end of my .bashrc file looks this way:

    source /opt/intel/composerxe-2011.4.191/bin/compilervars.sh ia32
    source /opt/openfoam210/etc/bashrc

    If I copy and paste the first source command in the shell the icc command is working

    Am I using the source command in the wrong way? Maybe is the second source "erasing" the first one?

  2. #2

    Re: use of source command in .bashrc

    Did you
    Code:
    source ~/.bashrc
    after editing/saving?
    Windows assumes the user is an idiot.
    Linux demands proof.

  3. #3
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: use of source command in .bashrc

    Quote Originally Posted by matteo-carli View Post
    Maybe is the second source "erasing" the first one?
    That's probably what happens, yes. I suspect the second script is setting your PATH variable regardless of what is previously there. Can you post the script, or at least any line containing "PATH"?
    「明後日の夕方には帰ってるからね。」


  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: use of source command in .bashrc

    Quote Originally Posted by Bachstelze View Post
    That's probably what happens, yes. I suspect the second script is setting your PATH variable regardless of what is previously there. Can you post the script, or at least any line containing "PATH"?
    I wouldn't bet on PATH, most scripts tend to add things to it instead of bluntly replacing it, but the use of "source" indeed hints at some environment variable being overwritten.

  5. #5
    Join Date
    Feb 2013
    Beans
    1

    Re: use of source command in .bashrc

    Hi all,

    Has anyone found a solution to this problem?

    Thanks!

Tags for this Thread

Bookmarks

Posting Permissions

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