On Fri, Aug 13, 2021 at 11:19:16PM +0800, Philippe Meunier wrote:
> Hello,
> 
> While porting a shell script from Linux to OpenBSD I came across the
> following:
[cut] 
> 2) Out of curiosity, is there an OpenBSD equivalent to GNU's '0,/^test$/d' ?

As far as I can see, the following would work the same as GNU's '0,/^test$/d':

        sed -e '1 { /^test$/d; }' -e '1,/^test$/d' file

That is, delete the first line if it is "test", otherwise delete from
line 1 the next line that is "test".

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.

Reply via email to