mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: handle odd c-shell sourcing patterns
- the result of lsof, which is used in the etc/cshrc to locate the installation, may contain trailing information about host and mount point. There is also a moderate concern with people sourcing the file indirectly with their own version in the same directory. For example, a 'etc/cshrc-site' that actually sources 'etc/cshrc'. This leads to multiple matches in the lsof output, so we only take the first one, stop there and hope they didn't do something even trickier.
This commit is contained in:
@ -54,7 +54,7 @@ setenv WM_PROJECT_VERSION plus
|
||||
# If the directory naming does not match WM_PROJECT, need to change here
|
||||
set projectName="$WM_PROJECT"
|
||||
set projectDir=`lsof +p $$ |& \
|
||||
sed -n -e 's@^[^/]*@@; s@\(/'"$projectName"'[^/]*\)/etc/cshrc[^/]*@\1@p'`
|
||||
sed -ne 's@^[^/]*@@;\@/'"$projectName"'[^/]*/etc/cshrc@{s@/etc/cshrc.*@@p; q}'`
|
||||
|
||||
# set projectDir="$HOME/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
|
||||
# set projectDir="/opt/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
|
||||
|
||||
Reference in New Issue
Block a user