February 22, 2016, 21:21
|
OpenFOAM's bashrc removing elements from $PATH
|
#1
|
Member
Join Date: Aug 2015
Posts: 37
Rep Power: 10
|
I've got OF2.3.0 installed in /opt/. I have observed that sourcing "/opt/openfoam230/etc/bashrc" within my .bashrc removes all entries beginning in "/opt/" from my PATH variable. On my system, both LaTeX and Matlab are installed in /opt/, so this makes these commands unavailable to me. I'm not sure whether this functionality is intentional, but - from my perspective - it should not be.
Digging through the source code, I've found that the script responsible is "openfoam230/bin/foamCleanPath", and that "openfoam230/etc/bashrc" calls this script with the argument $foamOldDirs, which is some sort of list of directories to filter. Looking at the corresponding files in OF3.0.x, it appears that the relevant scripts are still the same as in 2.3.0. I'm not sure what functionality is intended, so I won't go as far as proposing a specific change.
As a workaround, I have added the line "export PATH=$PATH:/opt/texbin:/opt/matlab/bin" to my .bashrc immediately after sourcing /opt/openfoam230/etc/bashrc to re-add the missing elements to PATH
|
|
|