From: Matt Coleman Date: Wed, 11 Apr 2018 20:42:11 GMT Subject: Re: [PATCH] specify encoding for sed command Message-ID: <3FE7BFB6-769A-4F11-9C3B-86D681B3502F@gmail.com> In-Reply-To: I found another (possibly better) way to fix this: > On Apr 10, 2018, at 3:18 AM, Matt Coleman 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).