From 13b86450c888c570e40763f55b743af10e29d8d9 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Mon, 9 Sep 2013 23:18:55 +0200 Subject: [PATCH] Now the script doesn't fail if sourced from cshrc but it can't detect its name and location (only tcsh) --HG-- branch : bgschaid/minorAdditionsBranch --- etc/cshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/cshrc b/etc/cshrc index fb381bba0..884869be5 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -36,7 +36,7 @@ unset WM_PROJECT_VERSION_ADDITION unsetenv WM_PROJECT_VERSION_ADDITION set called=($_) -if ( $#called != 1 ) then +if ( $#called > 1 ) then # tcsh - csh doesn't know about the location set thisScript=$called[2] set prefSettingFile=$thisScript.preset @@ -46,13 +46,13 @@ if ( $#called != 1 ) then source $prefSettingFile endif else - echo "csh - WM_PROJECT_VERSION_ADDITION not supported" + echo "csh or tcsh called from .cshrc - WM_PROJECT_VERSION_ADDITION not supported" endif setenv WM_PROJECT OpenFOAM setenv WM_PROJECT_VERSION 1.6-ext -if ( $#called != 1 ) then +if ( $#called > 1 ) then if( ! $?WM_PROJECT_VERSION_ADDITION ) then setenv WM_PROJECT_VERSION_ADDITION `python -c "from os.path import *;print abspath(join(curdir,'$thisScript')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"` if ( "$WM_PROJECT_VERSION_ADDITION" == "" ) then