diff --git a/Sports/Concept2/PM5/pm5conv.bash b/Sports/Concept2/PM5/pm5conv.bash index 72c362d..d53c0f6 100755 --- a/Sports/Concept2/PM5/pm5conv.bash +++ b/Sports/Concept2/PM5/pm5conv.bash @@ -1,10 +1,16 @@ #!/bin/bash -cmd="/home/alexander/Spielewiese/laymanshex/laymanshex" +cmd="laymanshex" accTable="LogDataAccessTbl.bin" storage="LogDataStorage.bin" +function assignVariables { + while read -r line; do + typeset -g "$line" + done <<< "$1" +} + i=0 while : ; do offset=$(($i*32)) @@ -13,17 +19,13 @@ while : ; do if [ $status -ne 0 ]; then break else - while read -r line; do - typeset -x "$line" - done <<< "$output" + assignVariables "$output" echo "Workout $Index" echo "=============" outputHeader="$($cmd -nopadding -fvar=offset=$Offset $storage-HeaderWorkout$WorkoutType.layhex $storage 2>/dev/null)" status=$? if [ $status -eq 0 ]; then - while read -r line; do - typeset -x "$line" - done <<< $outputHeader + assignVariables "$outputHeader" echo "TotalDuration=$HeaderTotalDuration" echo "TotalDistance=$HeaderTotalDistance" echo "SplitSize=$HeaderSplitSize"