seq 10 | awk 'ORS=NR%2 ? RS:RS RS'
seq 10 ........... gives us 1 to 10 (one by line)
| ................ pipes each line to awk
Awk uses a ternary operator like: statemente-condition ? if-true: if-false
If the result of Mod of NR equals to 1, it sets ORS to the RS (newline) if the result of Mod of NR equals to 0, it set ORS to RS RS (double newline) inserting hence a blank line
ORS .............. output register separator (default newline)
NR % 2 .......... Mod of the integer division of Number of Register (line number)
let's try something here:
echo '1%2' | bc
1
echo '2%2' | bc
0
echo '3%2' | bc
1
Therefore:
seq 10 | awk 'ORS=NR % 2 ? RS:RS RS'
ORS ............ separador de registro de saída
Caso o módulo da divisão do Número do Registro NR por 2 for igual a 1 atribua uma quebra de linha para o separador de registro de saída, caso contrário atribua duas quebras de linha para o separador de registro de saída