4.10.10 Replace character string
Function
In a Windows or Linux environment, all occurrences of a specific character string in the specified file are replaced with the specified replacement string.
The file is overwritten with the replacement results.
If there are no occurrences of the string to be replaced, the file is not updated.
The following describes the server that this plug-in requires:
- Execution target server
The server on which this plug-in is executed.
Notes on specifying the common.replaceTarget property:
- Regular expressions are not supported.
- If the OS of the execution target server is Windows, to specify the following symbols, prefix a backslash (\) to them as an escape character: \ [ ] ? ^ + * . @
Note, however, that to specify \ at the end of a character string or to specify only \, enter \\\\.
To specify a character string that includes spaces or any of the following symbols, prefix a grave accent mark (`) to the string as an escape character: # { } ' ; & , ` < >
To specify (, ), |, or $, prefix both a backslash and a grave accent mark (\`) to them as escape characters.
- If the OS of the execution target server is Linux, to use a backslash (\) as an ordinary character, specify \\ instead of \. Also, to use the following symbols, prefix a backslash (\) to them as an escape character: ! $ [ ] / . ^ *
- Never enter a double quotation mark (") regardless of whether the OS is Windows or Linux. To specify a double quotation mark ("), enter \0x22.
Notes on specifying the common.replaceStr property:
- If the OS of the execution target server is Windows, you can use the meta characters `t (tab) and `r`n (line break). To specify \ at the end of a character string or to specify only \, enter \\.
To specify a character string that includes spaces or any of the following symbols, prefix a grave accent mark (`) to the string as an escape character: ` # , @ | { } ' ; & ( ) < > $
- If the OS of the execution target server is Linux, you can use the meta characters \t (tab) and \n (line break). To use a backslash (\) as an ordinary character, specify \\, instead of \. Also, to include !, /, $, or & in a character string, prefix a backslash (\) to the string as an escape character.
- Never enter a double quotation mark (") regardless of whether the OS is Windows or Linux. To specify a double quotation mark ("), enter \0x22.
Use situation
This plug-in can be used to edit definition files.
Prerequisites
See Release Notes for the latest support statuses of prerequisite products in the system, prerequisite products on the execution target server, and OSs of prerequisite products on the execution target server.
Prerequisite products for the system:
Job Management Partner 1/Automatic Operation 10-50 or later
Prerequisite products for the execution-target server:
None.
Supported OSs for the prerequisite products for the execution-target server:
(1) Windows Server 2008 Standard/Enterprise (x86/x64), Windows Server 2008 R2 Standard/Enterprise/Datacenter
(2) Windows Server 2012 Standard/Datacenter, Windows Server 2012 R2 Standard/Datacenter
(3) Red Hat Enterprise Linux 5 Advanced Platform (x86), Red Hat Enterprise Linux 5 (x86), Red Hat Enterprise Linux 5 Advanced Platform (AMD/Intel 64), Red Hat Enterprise Linux 5 (AMD/Intel 64)
(4) Red Hat Enterprise Linux Server 6 (32-bit x86), Red Hat Enterprise Linux Server 6 (64-bit x86_64)
Conditions for using prerequisite products on the execution target server:
None.
Cautions
(1) Do not simultaneously execute multiple instances of this plug-in for the same file.
(2) You cannot specify surrogate pair characters or control characters.
Version
01.12.00
Category
OperatingSystem/Common/Basic
Plug-in name displayed in the task log
osReplaceString
Return code
0: Normal
14: Error (Mistake by user) File inaccessible
27: Error (Check with the task log about the error detail) Unidentified error
41: Error (An error has been detected in the component) 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 |
---|---|---|---|---|---|
common.strFilePath |
File path that replaces a character string |
Specify the full path for the file that replaces a character string. |
-- |
Input |
R |
common.replaceTarget |
Character string to be replaced |
Specify the character string to be replaced in the file. |
-- |
Input |
R |
common.replaceStr |
Replaced character string |
Specify the replaced character string. |
-- |
Input |
O |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |