Skip to content

Commit

Permalink
Merge pull request #3106 from larsewi/linesep
Browse files Browse the repository at this point in the history
ENT-10432: Added documentation on `const.linesep` variable
  • Loading branch information
nickanderson authored Nov 14, 2023
2 parents 9f5b5c6 + 2ef7a61 commit ec78597
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 ec78597

Please sign in to comment.