BBC.SHARED.JOBI.TEMPFILE-ADD

Summary

Object type
JOBI
Object Folder
PACKAGES/BEST-BLU/BBC.SHARED/SOURCE/TEMPFILES
Title
Adds text to a temporary file
Archive Key 1
-
Archive Key 2
-
Created
Andreas Büsching am: 2020-09-09 15:27:56
Last Modified
Andreas Büsching am: 2024-01-04 08:30:17 29 x
Last Used
-

Description

This include adds a line to a temporary file that has been created with the include BBC.SHARED.JOBI.TEMPFILE_CREATE

Requirements

  • Unix: bash
  • Windows: Powershell 7.0

Parameter

$ENTRY$
defines the line to add to the temporary file

Input

Output

Unix

$bbcs_temp_file
script variable containing the name of the temporary file

Windows

$bbcs_temp_file
powershell variable containing the name of the temporary file

Example

:include BBC.SHARED.JOBI.TEMPFILE-ADD $ENTRY$ = "<value>"

Process

:switch &$PLATFORM#
:case "UNIX"
:  set &item# = resolve_var( "$ENTRY$" )
:set &quoted# = "'"
:set &quoted# = str_cat( &quoted#, '"' )
:set &quoted# = str_cat( &quoted#, "'" )
:set &quoted# = str_cat( &quoted#, '"' )
:set &quoted# = str_cat( &quoted#, "'" )
:set &item# = str_sub( &item#, "'", &quoted# )
echo '&item#' >> $bbcs_temp_file
:case "WINDOWS"
:  inc BBC.SHARED.JOBI.ESCAPE4POWERSHELL $STRING$ = "$ENTRY$"
"&BBCS_ESCAPED_STRING_O#" | Add-Content $bbcs_temp_file.fullName
:other
:  p "unsupported platform &$PLATFORM#"
:endswitch