With the use of eval BLUE_DEV='blue0 net0' stored "blue0 net0" in the
variable BLUE_DEV not "'blue0 net0'"
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
continue
fi
+ # strip leading and trailing single quotes
+ val="${val#\'}"
+ val="${val%\'}"
+
printf -v "${array}[${key}]" "%s" "${val}"
done < "${file}"
}
# test if we read the correct data
test_value_in_array "CONFIG" "RED_DHCP_HOSTNAME" "ipfire"
test_value_in_array "CONFIG" "BLUE_MACADDR" "bc:30:7d:58:6b:e3"
+test_value_in_array "CONFIG" "BLUE_DEV" "blue0 net0"
# Test that comments are skipped
# apparently the way we read the file strips the whitespace, so the key does not contain any whitespace either