Sed - what is called this curly brace?

I just found this:

sed '/label/{n;n;s/{}/{some comment}/;}' 

The intended effect is to look for the label , continue 2 lines down ( n;n; ), and then replace with ( s ) some comment .

This is a terrific opportunity that sed never knew about.

Would someone be kind enough to indicate the name of this curly brace and the name of the class of operators inside curly braces?

I would like to go to Google and find out more :)

Sincere thanks.

+4
source share
1 answer

Sliding brackets allow you to group several commands so that they are executed for the same range of addresses ( link ). The fact is that you specify the address (with one or two line numbers or patterns), and then apply a group of commands to the corresponding lines.

The n command has nothing special and is documented in man as well as in a related document. I am not sure if there is a common name there.

From man sed :

n N Read / add the next line of input to the template space.

+5
source

Source: https://habr.com/ru/post/1435082/


All Articles