From 2ef7a6116c0c788110dfa5447049fca7dcd2670d Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 9 Nov 2023 17:48:58 +0100 Subject: [PATCH] Added documentation on `const.linesep` variable Ticket: ENT-10432 Changelog: None Signed-off-by: Lars Erik Wik --- reference/special-variables/const.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/reference/special-variables/const.markdown b/reference/special-variables/const.markdown index 0937888ff..a523ffd75 100644 --- a/reference/special-variables/const.markdown +++ b/reference/special-variables/const.markdown @@ -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 @@ -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