From d45d7ca8c3e4d1a4567109219ab21c4d82cca608 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 29 Nov 2018 12:45:45 +0100 Subject: [PATCH] STYLE: adjust looping parameter for _foamEval --- etc/config.sh/functions | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/etc/config.sh/functions b/etc/config.sh/functions index cd4f9d2550..eef3d9941d 100644 --- a/etc/config.sh/functions +++ b/etc/config.sh/functions @@ -159,9 +159,9 @@ then unset -f _foamEval 2>/dev/null _foamEval() { - while [ $# -gt 0 ] + for i do - case "$1" in + case "$i" in -*) # Stray option (not meant for us here) -> get out break @@ -175,22 +175,21 @@ then *=*) # name=value -> export name=value [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ] \ - && echo "export $1" 1>&2 - eval "export $1" + && echo "export $i" 1>&2 + eval "export $i" ;; *) # Filename: source it - if [ -f "$1" ] + if [ -f "$i" ] then [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ] \ - && echo "Using: $1" 1>&2 - . "$1" + && echo "Using: $i" 1>&2 + . "$i" else - _foamEtc -silent "$1" + _foamEtc -silent "$i" fi ;; esac - shift done }