From ae83eedec43bd4dc9425b115f7623b117e8d01ab Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sat, 26 Dec 2020 18:09:51 +0100 Subject: [PATCH] Make helper variables local to prefent side effects --- sequencer/sequencer.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sequencer/sequencer.sh b/sequencer/sequencer.sh index 55f4a6f..c92fc35 100755 --- a/sequencer/sequencer.sh +++ b/sequencer/sequencer.sh @@ -219,6 +219,7 @@ getReturn() { # MESSAGE : Custom error message # endReturn() { + local arg local forceExit=0 local errorCode=$ERNO local endMessage="" @@ -296,6 +297,7 @@ endReturn() { # 2 : Created empty configuration # 3 : No configuration created initSeqConfig() { + local arg local sourceAlways=0 local createEmpty=0 for arg in "$@" ; do @@ -376,6 +378,7 @@ initSeqConfig() { # if exists, one attempt is made to create bck file of it # if all fails, a log file is created with the conflicts to be resolved by the user addConf() { + local arg local confMode="" local transferCmd="echo" @@ -598,6 +601,7 @@ step() { # (max $MAX_STEP) # execute sequence continously from given starting step continous() { + local i local step=0 checkStep "$1" @@ -625,6 +629,7 @@ continous() { # execute given step list # e.g.: selection -q (1, 4, 12) selection() { + local i local step=0 local array=("$@") @@ -695,6 +700,7 @@ createTemplate() { # back reference variable of schema: # alias_[ALIAS]=[STEP NUMBER] parseAlias() { + local i for ((i=1; i<=${MAX_STEP}; i++)); do # Check for alias definition existsFunction step_${i}_alias @@ -715,6 +721,7 @@ parseAlias() { # 1 : Do not ask for template creation # Always display sequencer help and, if available, sequence help displayHelp() { + local i local createTemplate=1 local stepsFound=0 CONTEXT_HELP=1 @@ -827,6 +834,7 @@ exep() { } main() { + local arg local START=0 local EMPTYCALL=1