From: Eric Sunshine Date: Tue, 15 Jan 2019 21:09:22 GMT Subject: Re: [PATCH/RFC v1 1/1] test-lint: sed -E (or -a, -l) are not portable Message-ID: In-Reply-To: <20190115203038.10574-1-tboegi@web.de> On Tue, Jan 15, 2019 at 3:31 PM wrote: > From `man sed` (on a Mac OS X box): > The -E, -a and -i options are non-standard FreeBSD extensions and may not be available > on other operating systems. > [...] > To be on the safe side, don't allow it. > > Signed-off-by: Torsten Bögershausen > --- > diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl > @@ -35,7 +35,7 @@ sub err { > - /\bsed\s+-i/ and err 'sed -i is not portable'; > + /\bsed\s+-[Eail]/ and err 'Not portable option with sed. Only -e -f -n are portable'; > /\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)'; > /^\s*declare\s+/ and err 'arrays/declare not portable'; > /^\s*[^#]\s*which\s/ and err 'which is not portable (use type)'; Please update the new message to be more consistent with existing surrounding error messages. For instance: err 'sed -i/-a/-l/-E not portable (use only -e/-f/-n)' or something. Thanks.