current dev

This commit is contained in:
creme 2020-02-24 15:27:50 +01:00
parent 7cbb159a0f
commit 369e2421a9
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
1 changed files with 7 additions and 4 deletions

View File

@ -136,15 +136,17 @@ EOM
field_exists+=( "$user_field" )
line_to_set["$user_field","$count_field_entry"]+="$user_value"
else
# entry will be a array
# entry will be a array (max. 32 entrys)
if ! [[ ":${field_is_array[*]}:" =~ $user_field ]]; then
field_is_array+=( "$user_field" )
fi
count_field_entry="$(( "$count_field_entry" +1 ))"
count_field_entry="$(( "$count_field_entry" +1 ))" ; [ "$count_field_entry" -le '32' ] || continue
line_to_set["$user_field","$count_field_entry"]+="$user_value"
highest_count_field_entry["$user_field"]="$count_field_entry"
fi
fi
done <<< "$(tac "$INFO_FILE")" # read file from buttom
#done <<< "$(tac "$INFO_FILE")" # read file from buttom
done < "$INFO_FILE"
# add users custom entrys from line_to_set (single lines before arrays)
#
@ -180,7 +182,8 @@ EOM
cat << EOM >> "$TMP_JSON"
"${line_to_set[$field]}",
EOM
if [ "$field_count" -eq '0' ]; then
if [ "$field_count" -eq 0 ]; then
# ??? if [ "$field_count" = "$highest_count_field_entry" ]; then
# end of user def. array
# remove trailing ',' on last user entry
unset field_in_progress