[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS
From: |
Ralph Corderoy |
Subject: |
Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS) |
Date: |
Fri, 29 Oct 2021 10:07:39 +0100 |
Hi John,
> In lieu of escaped newlines and awkward sed(1) formatting, you can use
> the following line to insert an empty line:
>
> /^Before$/ { N; s/\n/&&/; }
With the caveat that the line read by N won't be processed as it would
have been otherwise. These two show the difference which might not
matter in some cases.
seq 10 29 | sed $'/5$/i\\\n\n/^2/s//x/'
seq 10 29 | sed $'/5$/{N;s/\\n/&&/}\n/^2/s//x/'
--
Cheers, Ralph.
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), (continued)
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), John Gardner, 2021/10/28
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), Larry McVoy, 2021/10/28
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), Ralph Corderoy, 2021/10/29
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), T. Kurt Bond, 2021/10/29
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), Deri, 2021/10/29
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), T. Kurt Bond, 2021/10/29
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS), Deri, 2021/10/29
- Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS),
Ralph Corderoy <=
Re: Sed failure in contrib/sboxes on MacOS, G. Branden Robinson, 2021/10/27