OUR SITES NetworkRADIUS FreeRADIUS

Double Quoted Strings

Syntax

"string"

A double-quoted string allows escape sequences and dynamic expansions. As with single-quoted strings, text within double quotes can include spaces.

The main difference between the single and double quoted strings is that the double quoted strings can be dynamically expanded. The syntax ${…​} is used for parse-time expansion and %{…​} is used for run-time expansion. The difference between the two methods is that the ${…​} form is expanded when the server loads the configuration files and is valid anywhere in the configuration files. The %{…​} string expansion form is valid only in conditional expressions and attribute assignments.

The output of the dynamic expansion can be interpreted as a string, a number, or an IP address, depending on its context.

Note that the interpretation of text strongly depends on the context. The text "0000" can be interpreted as a data type "integer", having value zero, or a data type "string", having value "0000". In general when a particular piece of text is used, it is used with the context of a known attribute. That attribute has a data type, and the text will be interpreted as that data type.

Most values retrieved from external datastores will be treated implicitly as double-quoted strings.

Escape sequences

Escape sequences allow the inclusion of characters that may be difficult to represent in datastores, or the FreeRADIUS configuration files.

Table 1. Escape sequences and their descriptions
Escape sequence Character represented

\\

Literal backslash (0x5c)

\r

Carriage return (0x0d)

\n

Line feed (0x0a)

\t

Horizontal tab (0x09)

\"

Double quote (0x22)

\x<hex><hex>

A byte whose numerical value is given by <hex><hex> interpreted as a hexadecimal number.

\x<oct><oct><oct>

A byte whose numerical value is given by <oct><oct><oct> interpreted as an octal number.

Examples

"word"
"a string"'
`"foo\"bar\""

"this is a long string"
"this has embedded\ncharacters"
"attribute\tvalue\nusername\t%{User-Name}\nreply-message\t%{reply.Reply-Message}" "The result of 'SELECT * FROM foo WHERE 1' is: %{sql:SELECT * FROM foo WHERE 1}"