Skip to content

Commit

Permalink
Added documentation on const.linesep variable
Browse files Browse the repository at this point in the history
Ticket: ENT-10432
Changelog: None
Signed-off-by: Lars Erik Wik <[email protected]>
  • Loading branch information
larsewi committed Nov 9, 2023
1 parent 9f5b5c6 commit 2ef7a61
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions reference/special-variables/const.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ reports:
"The value of $(const.dollar)(const.dirsep) is $(const.dirsep)";
```

### const.linesep

```cf3
reports:
# On Unix hosts this will report: The value of $(const.linesep) is \n
# On Windows hosts this will report: The value of $(const.linesep) is \r\n
"The value of $(const.dollar)(const.linesep) is $(const.linesep)";
```

**History:** Introduced in CFEngine 3.23.0

### const.endl

```cf3
Expand All @@ -54,6 +66,11 @@ reports:
"But a string with \n in it does not have a newline!";
```

**Note:** The variable `const.endl` is an alias for `const.n` and nothing more.
It is commonly mistaken to be a platform agnostic line separator. But this has
never been the case. However, since CFEngine 3.23 we introduced `const.linesep`
which is exactly that.

### const.n

```cf3
Expand Down

0 comments on commit 2ef7a61

Please sign in to comment.