etc/bashrc: removed sourcing of additional files passed as
arguments to the original sourced file. Caused an infinite loop if original source command
is called within a function, e.g.
sourceFile() {
. $1
}
This commit is contained in:
@ -158,10 +158,10 @@ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
|
|||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
|
||||||
|
|
||||||
# Evaluate command-line parameters and record settings for later
|
# Evaluate command-line parameters of the form "param=keyword" or unset
|
||||||
# these can be used to set/unset values, or specify alternative pref files
|
# parameters with "param="
|
||||||
export FOAM_SETTINGS="$@"
|
export FOAM_SETTINGS="$@"
|
||||||
_foamEval $@
|
_foamParams $@
|
||||||
|
|
||||||
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -48,7 +48,7 @@ then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
_foamEval()
|
_foamParams()
|
||||||
{
|
{
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
@ -67,15 +67,6 @@ then
|
|||||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" 1>&2
|
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" 1>&2
|
||||||
eval "export $1"
|
eval "export $1"
|
||||||
;;
|
;;
|
||||||
*)
|
|
||||||
# Filename: source it
|
|
||||||
if [ -f "$1" ]
|
|
||||||
then
|
|
||||||
_foamSource "$1"
|
|
||||||
else
|
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -117,6 +108,6 @@ else
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~
|
||||||
unset WM_BASH_FUNCTIONS
|
unset WM_BASH_FUNCTIONS
|
||||||
unset _foamAddPath _foamAddLib _foamAddMan
|
unset _foamAddPath _foamAddLib _foamAddMan
|
||||||
unset _foamSource _foamEval
|
unset _foamSource _foamParams
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
12
etc/cshrc
12
etc/cshrc
@ -151,8 +151,8 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!*
|
|||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
||||||
|
|
||||||
# Evaluate command-line parameters and record settings for later
|
# Evaluate command-line parameters of the form "param=keyword" or unset
|
||||||
# these can be used to set/unset values, or specify alternative pref files
|
# parameters with "param="
|
||||||
setenv FOAM_SETTINGS "${*}"
|
setenv FOAM_SETTINGS "${*}"
|
||||||
while ( $#argv > 0 )
|
while ( $#argv > 0 )
|
||||||
switch ($argv[1])
|
switch ($argv[1])
|
||||||
@ -171,12 +171,8 @@ while ( $#argv > 0 )
|
|||||||
eval "setenv $argv[1]:s/=/ /"
|
eval "setenv $argv[1]:s/=/ /"
|
||||||
breaksw
|
breaksw
|
||||||
default:
|
default:
|
||||||
# filename: source it
|
# ignore non-parameter arguments, e.g. filenames
|
||||||
if ( -f "$1" ) then
|
break
|
||||||
_foamSource "$1"
|
|
||||||
else
|
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
|
||||||
endif
|
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in New Issue
Block a user