Fixed a fatal error in mlog2db when calling the script with more than 9 parameters (when using a long run-list in [...] form)
This commit is contained in:
parent
943494f4dc
commit
9021cea268
9
src/external/scripts/mlog2db
vendored
9
src/external/scripts/mlog2db
vendored
@ -84,6 +84,7 @@ else
|
|||||||
# In case a list of runs is given by [...]
|
# In case a list of runs is given by [...]
|
||||||
if [ "${1:0:1}" == "[" ]; then
|
if [ "${1:0:1}" == "[" ]; then
|
||||||
RUNARRAY=($@)
|
RUNARRAY=($@)
|
||||||
|
|
||||||
if [ "$1" == "[" ]; then
|
if [ "$1" == "[" ]; then
|
||||||
RUNARRAY[0]=""
|
RUNARRAY[0]=""
|
||||||
else
|
else
|
||||||
@ -109,7 +110,7 @@ else
|
|||||||
# search for the parameter including the "]"
|
# search for the parameter including the "]"
|
||||||
for (( i=1; i<="$#"; i++ ))
|
for (( i=1; i<="$#"; i++ ))
|
||||||
do
|
do
|
||||||
RIGHTBRACKET=$( eval echo \$$i )
|
RIGHTBRACKET=$( eval echo \${$i} )
|
||||||
if [ "${RIGHTBRACKET:(-1)}" == "]" ]; then
|
if [ "${RIGHTBRACKET:(-1)}" == "]" ]; then
|
||||||
RIGHTBRACKET=$i
|
RIGHTBRACKET=$i
|
||||||
break
|
break
|
||||||
@ -125,7 +126,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EXTENSION=$( eval echo \$$((RIGHTBRACKET + 1)) )
|
EXTENSION=$( eval echo \${$((RIGHTBRACKET + 1))} )
|
||||||
FIRST_OPT_PAR=$((RIGHTBRACKET + 2))
|
FIRST_OPT_PAR=$((RIGHTBRACKET + 2))
|
||||||
LAST_OPT_PAR=$#
|
LAST_OPT_PAR=$#
|
||||||
RUNLIST_USED=0
|
RUNLIST_USED=0
|
||||||
@ -353,8 +354,8 @@ else
|
|||||||
|
|
||||||
for (( l="$FIRST_OPT_PAR"; l<="$LAST_OPT_PAR"; l++ ))
|
for (( l="$FIRST_OPT_PAR"; l<="$LAST_OPT_PAR"; l++ ))
|
||||||
do
|
do
|
||||||
CUR_PAR=$( eval echo \$$l )
|
CUR_PAR=$( eval echo \${$l} )
|
||||||
NEXT_PAR=$( eval echo \$$((l+1)) )
|
NEXT_PAR=$( eval echo \${$((l+1))} )
|
||||||
if [ "${CUR_PAR:0:2}" == "-o" ]; then
|
if [ "${CUR_PAR:0:2}" == "-o" ]; then
|
||||||
if [ "$CUR_PAR" == "-o" ]; then
|
if [ "$CUR_PAR" == "-o" ]; then
|
||||||
if [ "$l" -ne "$LAST_OPT_PAR" ] && [ "$NEXT_PAR" != "noheader" ] && [ "$NEXT_PAR" != "nosummary" ] \
|
if [ "$l" -ne "$LAST_OPT_PAR" ] && [ "$NEXT_PAR" != "noheader" ] && [ "$NEXT_PAR" != "nosummary" ] \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user