Re: [PATCH] specify encoding for sed command
- From
- Matt Coleman <cat.moleman@gmail.com>
- Date
- Apr 11, 2018, 20:42 UTC
- Message-ID
- <3FE7BFB6-769A-4F11-9C3B-86D681B3502F@gmail.com>
- In-Reply-To
- <DB5A1CE2-7844-4CB6-A03E-6AAC4EC13D66@gmail.com>
I found another (possibly better) way to fix this:
Show 6 quoted lines
> On Apr 10, 2018, at 3:18 AM, Matt Coleman <cat.moleman@gmail.com> wrote: > >> 1) What platform OS / version / sed version is this on? > I'm experiencing this on macOS Sierra (10.12.6). The issue occurs with the OS's native sed, which is FreeBSD sed so the version number is kind of ambiguous. > > The error goes away if I set LANG=C or LC_ALL=C or change it to use GNU sed (installed via homebrew as gsed).
If I change it to use awk instead of sed, it works with mawk, gawk, and macOS awk: unset $(set | awk -F '=' '/^__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*=/ {print $1}') 2>/dev/null
I compared sed vs. awk on Linux and Mac and they all take about the same amount of time to run (within 0.002ms).