Thread (59 messages) flat view 59 messages, 8 authors, 2019-02-01

Re: [PATCH/RFC v1 1/1] test-lint: sed -E (or -a, -l) are not portable

From: Eric Sunshine <hidden>
Date: 2019-01-15 21:09:35

On Tue, Jan 15, 2019 at 3:31 PM [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help