.edit

.edit /<search_expression>/<replace_expression>/ [<relative_path>/]file [file ...]

Use the .edit command to search and replace text strings in one or more files. The .edit command replaces the first instance of the string (search_expression) on each and every line in each file specified. Files are assumed to reside in the step's working directory unless you specify a relative path.

The .edit command implements standard POSIX regular expressions for matching and replacement, including the use of () substring selection and \N substitution in the replacement pattern.

The .edit command uses POSIX Extended Regular Expression syntax by default. If the agent has been compiled with Perl Compatible Regular Expression support, then the substitution expression may be followed with a "p" character to specify PCRE syntax.

Using backslash as an escape character requires different handling depending on the operating system on the agent host.

You cannot escape delimiters. In cases where that seems desirable, the correct approach is to use an alternate delimiter character. Example: you have a file abc.txt that contains only the characters abc. You want to replace it with the string a/c:

Note: You must explicitly list one or more file names, without wildcards.
Example: The following command replaces strings such as winXPdriver and win2000driver in the file called drivermakefile.
.edit /win.*driver/linuxdriver/ drivermakefile
The .edit command is similar to the .strsub command; differences include:

Feedback