From e8e79cc9eb1c6c9ac3b1fa5210bdb7671f722e82 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Tue, 7 Dec 2010 15:30:22 +0100 Subject: [PATCH] ENH: add command-line mechanism for specifying user prefs - eg, . PATH_TO_FOAM/etc/bashrc myPrefs.sh --- etc/bashrc | 9 +++++++++ etc/cshrc | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/etc/bashrc b/etc/bashrc index c6aa4608469..8bbc1b2c2dd 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -101,6 +101,15 @@ do # name=value -> export name=value eval "export $1" ;; + *) + # filename: source it + if [ -f "$1" ] + then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` + fi + ;; esac shift done diff --git a/etc/cshrc b/etc/cshrc index 25628ab4072..719a211f532 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -85,6 +85,14 @@ while ( $#argv > 0 ) # name=value -> setenv name value eval "setenv $argv[1]:s/=/ /" breaksw + default: + # filename: source it + if ( -f "$1" ) then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` + endif + breaksw endsw shift end -- GitLab