String concatenation: Difference between revisions
Content added Content deleted
(→sed: add) |
|||
Line 2,073: | Line 2,073: | ||
-->s2 |
-->s2 |
||
Hello world! </pre> |
Hello world! </pre> |
||
=={{header|sed}}== |
|||
There are no variables in ''sed'', just two distinct locations for storing a string: The "pattern space" and the "hold space". |
|||
The pattern space contains the current input line. With the <code>h</code> command, it is copied to the hold space. Then, the <code>s</code> command appends a string literal to the pattern space: |
|||
<syntaxhighlight lang="sed">h |
|||
s/$/String Literal/</syntaxhighlight> |
|||
If necessary, the content of both spaces could be exchanged by a final <code>x</code> command. |
|||
=={{header|Seed7}}== |
=={{header|Seed7}}== |