Re: [PATCH 1/2] t8005: avoid grep on non-ASCII data
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 21, 2016, 23:31 UTC
- Message-ID
- <xmqqsi0l8wt8.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAPig+cQ9n4Eg73Uyeg_g_4wzebuwn8=0R-LMb8F9QLFxanwVVg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
> These tests all crash and burn with BSD sed (including Mac OS X) since > you're not restricting yourself to BRE (basic regular expressions). > You _could_ request extended regular expressions, which do work on > those platforms, as well as with GNU sed: > > sed -nEe "/^(author|summary) /p" ...
An obvious way to avoid any RE is to write it as two separate statements. As there are repeated invocations of this filtering in this script, perhaps a helper function can hide this ugliness?