Re: [PATCH v1 1/1] test-lint: echo -e (or -E) is not portable
Torsten Bögershausen writes: > Junio, if you wouldn't mind to squash that in, > another fix is needed as well(trailing '-' after '-E') : > > s/'-n', '-e' or '-E-'/'-n', '-e' or '-E' Yup. Thanks all.
Re: [PATCH v1 1/1] test-lint: echo -e (or -E) is not portable
On Tue, Sep 19, 2017 at 01:37:14PM -0700, Jonathan Nieder wrote: > Torsten Bögershausen wrote: > > > Some implementations of `echo` support the '-e' option to enable > > backslash interpretation of the following string. > > As an addition, they support '-E' to turn it off. > > nit: please wrap the commit message to a consistent line width. > > > However, none of these are portable, POSIX doesn't even mention them, > > and many implementations don't support them. > > > > A check for '-n' is already done in check-non-portable-shell.pl, > > extend it to cover '-n', '-e' or '-E-' > > > > Signed-off-by: Torsten Bögershausen > > --- > > t/check-non-portable-shell.pl | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > An excellent change. Thanks for noticing and fixing this. > > Reviewed-by: Jonathan Nieder Thanks for the review. Junio, if you wouldn't mind to squash that in, another fix is needed as well(trailing '-' after '-E') : s/'-n', '-e' or '-E-'/'-n', '-e' or '-E' ^
Re: [PATCH v1 1/1] test-lint: echo -e (or -E) is not portable
Torsten Bögershausen wrote: > Some implementations of `echo` support the '-e' option to enable > backslash interpretation of the following string. > As an addition, they support '-E' to turn it off. nit: please wrap the commit message to a consistent line width. > However, none of these are portable, POSIX doesn't even mention them, > and many implementations don't support them. > > A check for '-n' is already done in check-non-portable-shell.pl, > extend it to cover '-n', '-e' or '-E-' > > Signed-off-by: Torsten Bögershausen > --- > t/check-non-portable-shell.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) An excellent change. Thanks for noticing and fixing this. Reviewed-by: Jonathan Nieder
[PATCH v1 1/1] test-lint: echo -e (or -E) is not portable
From: Torsten Bögershausen Some implementations of `echo` support the '-e' option to enable backslash interpretation of the following string. As an addition, they support '-E' to turn it off. However, none of these are portable, POSIX doesn't even mention them, and many implementations don't support them. A check for '-n' is already done in check-non-portable-shell.pl, extend it to cover '-n', '-e' or '-E-' Signed-off-by: Torsten Bögershausen --- t/check-non-portable-shell.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl index b170cbc045..03dc9d2852 100755 --- a/t/check-non-portable-shell.pl +++ b/t/check-non-portable-shell.pl @@ -17,7 +17,7 @@ sub err { while (<>) { chomp; /\bsed\s+-i/ and err 'sed -i is not portable'; - /\becho\s+-n/ and err 'echo -n is not portable (please use printf)'; + /\becho\s+-[neE]/ and err 'echo with option is not portable (please use printf)'; /^\s*declare\s+/ and err 'arrays/declare not portable'; /^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)'; /\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)'; -- 2.14.1.145.gb3622a4ee9