Commit b6cb62a5 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

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

  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
parent 38c56c5c
......@@ -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"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment