Make use of sed's line-handling ability
With flexible challenge outputI/O, it can pay to have input/output separated by newlines instead of any other character by taking advantage of sed's commands for handling lines (like D
, N
, n
, G
, H
, P
, s
's m
flag) instead of only being limited to s
substitutions.
This can also open the opportunity for using D
for looping instead of labels and goto, especially in sed versions that don't permit empty labels.