Stream Editor Branches - Sed (Stream Editor)

How to create branches in Stream Editor?

The t command can be used to create branches If and only if the previous alternate command succeeds, the t command jumps to the label.
Instead of printing a hyphen (-), print the four hyphens using the same example as the previous chapter. The following example shows how to use the t command.

When you execute the above code, you fetch the following result:

In the above example, the first two commands are self-evident. The third command defines the label Loop. In the fourth command, if the line contains the string "Paulo", a hyphen (-) is appended, and the t command repeats the process until there is four hyphens at the beginning of the line.

For readability, each SED command is written to a separate line. Otherwise, you can write the SED line as follows.

When you execute the above code, you fetch the following result:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Sed (Stream Editor) Topics