unset csh environment variables when sourcing cshrc twice
In a c-shell if sourcing
~OpenFOAM/OpenFOAM-v2112/etc/cshrc MORE THAN ONCE, the OpenFOAM paths are missing from the environment variable
$PATH and so OpenFOAM code will no longer operate.
Steps to reproduce
> source ~OpenFOAM/OpenFOAM-v2112/etc/cshrc > echo $PATH > source ~OpenFOAM/OpenFOAM-v2112/etc/cshrc > echo $PATH
What is the current bug behaviour?
OpenFOAM paths are missing from
What is the expected correct behavior?
OpenFOAM paths are in
Relevant logs and/or images
- OpenFOAM version :v2112 (and possibly earlier)
- Operating system : centos or any (presumably)
- Hardware info :
- Compiler :gcc or any (presumably)
etc/config.csh/setup there are two occurrences of the following three lines:
_foamClean PATH "$foamOldDirs" _foamClean MANPATH "$foamOldDirs" _foamClean -lib "$foamOldDirs"
If you replace the second occurrence by
_foamClean PATH _foamClean MANPATH _foamClean -lib
This fixes the issue.