Skip to content

Commit 1a6d468

Browse files
tboegigitster
authored andcommitted
test-lint: echo -e (or -E) is not portable
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94c9fd2 commit 1a6d468

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/check-non-portable-shell.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sub err {
1717
while (<>) {
1818
chomp;
1919
/\bsed\s+-i/ and err 'sed -i is not portable';
20-
/\becho\s+-n/ and err 'echo -n is not portable (please use printf)';
20+
/\becho\s+-[neE]/ and err 'echo with option is not portable (please use printf)';
2121
/^\s*declare\s+/ and err 'arrays/declare not portable';
2222
/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
2323
/\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';

0 commit comments

Comments
 (0)