2.10. Data Type path

A path is something special to YCP and similar to paths in TCL. It is a sequence of path elements separated by dots. A path element can contain any characters except \x00. If it contains something else than a-zA-Z0-9_- it must be enclosed in double quotes. The root path, i.e. the root of the tree is denoted by a single dot. Paths can be used for multiple purposes. One of their main tasks is the selection of data from complex data structures like the SCR-tree (see Chapter 2, SCR Tree).

The backslash in paths can be used to mark a special characters:

RepresentationMeaning
\nNewline (ASCII 10)
\tTabulator
\rCarriage Return (ASCII 13)
\bBackspace
\fForm Feed
\xXX ASCII character represented by the hexadecimal value XX.
\XThe character X itself.

Example 2.8. Path constants

.
.17
.etc.fstab
."\nHello !\n".World

."\xff" == ."\xFF"
."\x41" == ."A"
."" != .