Correct way to source .bashrc for non-interactive shell

前端 未结 1 1008
北海茫月
北海茫月 2021-01-24 00:02

I have been trying to resolve problems to be able to run openmpi on multiple nodes.

Initially I had a problem with $PATH and $LD_LIBRARY_PATH v

1条回答
  •  [愿得一人]
    2021-01-24 00:48

    maybe you should run like this.I guess. two ways help you!

    first:

    mpirun --prefix /home/usama/.openmpi --hostfile hosts -np 4 . ~/.bashrc && bash script
    

    second:

    ## 1. add this line to the script
    . ~/.bashrc
    
    ## 2. run command as you do
    mpirun --prefix /home/usama/.openmpi --hostfile hosts -np 4 bash script
    
    

    0 讨论(0)
提交回复
热议问题