Hitachi

JP1 Version 12 JP1/Automatic Operation Service Template Reference


4.13.44 Adding a character string

Function

This plug-in adds a character string to the end of a file.

The path of the target file is specified by the common.strFilePath property, and the character string to be added is specified by the common.addStr property. This plug-in adds the specified character string to the line following the line containing "End Of File", and then inserts a line break after the added character string. If the specified file does not exist, this plug-in creates the file, adds the specified character string, and then inserts a line break.

The value of the common.strFilePath property cannot include wildcard characters.

If the OS of the execution-target server is Windows, the default character encoding is applied to the added character string. If the OS is UNIX, the character encoding specified by the LANG environment variable is applied.

Notes on the target file (common.strFilePath property):

- Specify the file by its full path name.

- If the file does not exist, this plug-in creates the file and then adds the specified character string to the file.

- If the specified file path includes non-existent folders, this plug-in creates the folders and the target file, and then adds the specified character string to the file.

Notes on the character string to be added (common.addStr property):

- The use of regular expressions is not supported.

- Regardless of whether the OS is Windows or UNIX, do not enter double quotation marks (") and single quotation marks ('). If the OS of the execution-target server is Windows or Linux, to use a double quotation mark (") as an ordinary character, enter "\0x22". To use a single quotation mark (') as an ordinary character, enter "\0x27". If the OS of the execution-target server is AIX, to use a double quotation mark (") as an ordinary character, enter "\\0x22". To use a single quotation mark (') as an ordinary character, enter "\\0x27".

- If the OS of the execution-target server is Windows, you can use the meta characters "`t" (tab) and "`r`n" (line break).

- If the OS of the execution-target server is UNIX, you can use the meta characters "\t" (tab) and "\n" (line break). However, for Linux, the trailing "\n" (line break) in the character string will be ignored. For AIX, if "\\0x22" or "\\0x27" has been entered into the character string, the trailing "\n" (line break) will be ignored.

Use situation

This plug-in can be used to edit definition files.

Prerequisites

For the most recent information about the prerequisite products in the system, the prerequisite products on the execution-target server, and the supported OSs on the execution-target server, see the Release Notes.

[Prerequisite products in the system]

JP1/Automatic Operation 11-00 or later

[Prerequisite products on the execution-target system]

None.

[Supported OSs on the execution-target server]

(1) Windows Server 2008 R2 Standard/Enterprise/Datacenter

(2) Windows Server 2012 Standard/Datacenter or Windows Server 2012 R2 Standard/Datacenter

(3) Windows Server 2016 Standard/Datacenter

(4) Windows Server 2019 Standard/Datacenter

(5) Red Hat Enterprise Linux Server 6 (32-bit x86) or Red Hat Enterprise Linux Server 6 (64-bit x86_64)

(6) Red Hat Enterprise Linux Server 7 (64-bit x86_64)

(7) Red Hat Enterprise Linux Server 8 (64-bit x86_64)

(8) CentOS 6 (64-bit x86_64)

(9) CentOS 7 (64-bit x86_64)

(10) CentOS 8 (64-bit x86_64)

(11) Oracle Linux 8 (64-bit x86_64)

(12) AIX V6

(13) AIX V7

[Conditions for using the prerequisite products on the execution-target server]

None.

Cautions

(1) For the common.strFilePath property, do not specify any string that includes double quotation marks (") or single quotation marks (').

(2) Do not use this plug-in for binary files. If this plug-in is used for a binary file, the file might become corrupted.

(3) Make sure multiple instances of this plug-in do not simultaneously write data to the same file. If multiple instances of this plug-in write to the same file simultaneously, the processing to add character strings might fail.

(4) If LC_ALL, LC_MESSAGES, or another locale environment variable whose level is higher than LANG is set, the higher-level locale environment variable might override the specification of the LANG environment variable. For this reason, before executing the plug-in, clear the LC_ALL, LC_MESSAGES, and other higher-level locale environment variables. Alternatively, set them to the same value as LANG.

Version

02.02.00

Plug-in tags

Control OS,Windows,Linux,AIX

Plug-in name displayed in the task log

osAddString

Return code

0: Normal

12: Error (Mistake by user) Invalid property

27: Error (Check with the task log about the error detail) Unidentified error

41: Error (An error has been detected in the plug-in) Property not entered (An error has been detected in the component script)

Property list

The following table lists the properties:

Property key

Property name

Description

Default value

I/O type

Required

plugin.destinationHost

Host name of the execution target server

Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported.

--

Input

R

common.strFilePath

File path to which character strings will be added

Specify the file path to which character strings will be added.

--

Input

R

common.addStr

Character string to be added

Specify the character string to be added to the file. We recommend that you specify a string of 1024 characters or less. If you specify a character string that exceeds the recommended value, part of the specified character string may be deleted depending on the OS of the execution target server.

--

Input

R

common.returnValue

Return value for the plugin

The return value of this plugin stored.

--

Output

--