failure: Hex string must have even count of elements!

I’m trying to add a DHCP server option by concatenating two string variables into one single string.

:global controlIP "11.11.111.11";
:global hexChar "";  #STR storing hex character
:global option43hex ""; #STR storing entire Option43 value

:set $hexChar "c"

# BELL char used. "s" character is needed in the string.
:set $option43hex ("0x060$hexChar\as'$controlIP'")

/ip dhcp-server option
	add code=43 name=Option43 value=$option43hex

Once I do the command to create the option I’m getting this error:

failure: Hex string must have even count of elements!

:put is showing the right string I’m expecting once everything is concatenated:

0x060cs'11.11.111.11'

I’m able to enter that value manually, however when I use my code to add the value the error is happening. What’s causing the error, and what can I do to get around it?

*Edit: Fixed a typo.

I found the solution. It looks as though the bell character was causing a syntax error. Using the format below to concatenate the strings fixed my problem:


:set $option43hex ("0x060" . $hexChar . "s'$controlIP'")