R
- the generic return type for all command signature methods
to support different implementor types; the methods of a
command factory for instance returns a command instance;
command builders can also implement this interface, but their
methods return the builder itself enabling for chained method
invocation to create joined commandspublic static interface Sed.Interface<R> extends CommandInterface<R>
Modifier and Type | Method and Description |
---|---|
R |
sed(SedOptions options,
String regexp)
Executes the sed command specified by the given options or executes
the print command p if no command option has been declared.
|
R |
sed(SedOptions options,
String string1,
String string2)
Executes the sed command specified by the given options or executes
the substitute command s if no command option has been declared.
|
R |
sed(SedOptions options,
String string1,
String string2,
int... occurrence)
Executes the sed command specified by the given options or executes
the substitute command s if no command option has been declared.
|
R |
sed(String... args)
Executes the sed script specified by the given arguments and writes
the result to the standard output.
|
R |
sed(String script)
Executes the given sed script, such as "s/original/replacement/g".
|
R |
sed(String regexp,
String replacement)
Substitutes the replacement string for instances of the regexp in
the matched line.
|
R |
sed(String regexp,
String replacement,
int... occurrence)
Substitutes the replacement string for instances of the regexp in
the matched line.
|
R sed(String... args)
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--script" operand have to be prefixed with the operand name.
args
- String arguments defining the options and operands for the command.
Options can be specified by acronym (with a leading dash "-") or by
long name (with two leading dashes "--"). Operands other than the
default "--script" operand have to be prefixed with the operand name
(e.g. "--occurrence" for subsequent occurrence indices).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(String script)
script
- Sed script as one string, such as "s/original/replacement/g".<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(String regexp, String replacement)
The characters "$0" appearing in the replacement are replaced by the line matching the regexp. The characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
A line can be split by substituting a newline ('\n') into it.
A substitution is considered to have been performed even if the replacement string is identical to the string that it replaces.
regexp
- Regular expression matched against a line.replacement
- Replacement string for substitute command. The characters "$0"
appearing in the replacement are replaced by the line matching
the regexp. The characters "$n", where n is a digit other than zero,
are replaced by the text matched by the corresponding backreference
expression (aka group). The special meaning of "$n" in this context
can be suppressed by preceding it by a backslash.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(String regexp, String replacement, int... occurrence)
The characters "$0" appearing in the replacement are replaced by the line matching the regexp. The characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
A line can be split by substituting a newline ('\n') into it.
A substitution is considered to have been performed even if the replacement string is identical to the string that it replaces.
regexp
- Regular expression matched against a line.replacement
- Replacement string for substitute command. The characters "$0"
appearing in the replacement are replaced by the line matching
the regexp. The characters "$n", where n is a digit other than zero,
are replaced by the text matched by the corresponding backreference
expression (aka group). The special meaning of "$n" in this context
can be suppressed by preceding it by a backslash.occurrence
- Substitute for the given occurrences only of the regexp found within
the matched string; the occurrence indices are one-based. If empty
or omitted, all occurrences are substituted.
(This operand only applies to the substitute command and is ignored by all other commands).
<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(SedOptions options, String regexp)
options
- Sed options and commandsregexp
- Regular expression matched against a line.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(SedOptions options, String string1, String string2)
options
- Sed options and commandsstring1
- Regular expression matched against a line for all commands except
for command y where string1 contains the source characters for the
translation.string2
- Replacement string for substitute command s; appended, inserted or
changed text for a, i and c command; destination characters for
translate command y; ignored by all other commands.
If string2 is a replacement string for the substitute command: the characters "$0" appearing in the replacement are replaced by the line matching the regexp; the characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
(This operand only applies to the commands s, a, i, c and y and is ignored by all other commands).
<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsR sed(SedOptions options, String string1, String string2, int... occurrence)
The string1 operand usually contains the regular expression matched against a line for all commands except for command y where string1 contains the source characters for the translation.
The string2 operand contains the replacement string for the substitute command s. It contains the appended, inserted or changed text for the commands a, i and c, respectively, and the destination characters for the translate command y. All other commands ignore the string2 operand.
options
- Sed options and commandsstring1
- Regular expression matched against a line for all commands except
for command y where string1 contains the source characters for the
translation.string2
- Replacement string for substitute command s; appended, inserted or
changed text for a, i and c command; destination characters for
translate command y; ignored by all other commands.
If string2 is a replacement string for the substitute command: the characters "$0" appearing in the replacement are replaced by the line matching the regexp; the characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
(This operand only applies to the commands s, a, i, c and y and is ignored by all other commands).
occurrence
- Substitute for the given occurrences only of the regexp found within
the matched string; the occurrence indices are one-based. If empty
or omitted, all occurrences are substituted.
(This operand only applies to the substitute command and is ignored by all other commands).
<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsCopyright © 2024. All rights reserved.