One ugly take on these cases is adding an extra line at the beginning of the input.
| sed 1p | And then change that 0 to 1. Not pretty but does the job. /Alexander On August 14, 2021 10:46:53 AM GMT+02:00, Philippe Meunier <meun...@ccs.neu.edu> wrote: >Michael Hekeler wrote: >>Your first address is 0? >>What do you expect from a line number 0? > >On OpenBSD I would have expected an error. > >>You can do: >>sed '/^test$/d' OR > >That deletes all the '^test$' lines regardless of where they are in the input. > >>sed 1d OR > >That deletes the first line of input. > >The nice thing about GNU's '0,/^test$/d' is that it deletes all the lines >from the beginning of the input up to and including the first '^test$', >whether that first ^test$' is the first line of the input or not. > >I guess the way to do something like this on OpenBSD would be to switch >from sed to awk. Anyway... > >Best, > >Philippe > >