File Replace String activity

reference brazil Updated Sep 10, 2026 1 min read r_FileReplaceStringActivity-1.md
Raw file

The File Replace String activity finds and replaces a string in a file on a Linux or UNIX computer.

This activity replaces an SSH activity by the same name available in releases prior to Istanbul. If you have a workflow created in a previous version that uses the deprecated activity, your workflow will continue to work normally after upgrading to Istanbul. However, all new workflows must use the custom version of this activity. This activity was built with the SSH activity template, which gives workflow administrators the ability to store input and output variables in the databus.

Input variables

Variable

Description

hostname

Hostname or IP address of destination server for SSH activity.

directory

Name of the working (target) directory.

file

Name of the file in which the string is to be replaced.

find_pattern

A regular expression of the text to replace.

replace_string

The replacement string for the text found by the expression in the find_pattern variable.

options

Replacement options:- first: Replaces the first occurence of the pattern.

  • all: Replaces all occurrences of the pattern.
## Output variables
Variable Description
return_code Indicates whether or not the string was replaced successfully in the target file.
error_message Message that indicates if an error has occurred. Any value other than 0 indicates a failure.

Conditions

Condition Description
Success The activity has successfully replaced the string in the file.
Failure The activity has failed to replaced the string in the file.

Parent Topic:SSH activity pack

Search documentation
Search document titles and file paths on the brazil branch