{"thread":{"id":"33603","subject":"[PATCH] check-non-portable-shell: echo -e is not portable","startedAt":"2013-04-25T18:48:04Z","lastAt":"2013-04-25T18:48:04Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"215469","messageId":"201304252048.04553.tboegi@web.de","threadId":"33603","inReplyTo":null,"subject":"[PATCH] check-non-portable-shell: echo -e is not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-04-25T18:48:04Z","receivedAt":"2013-04-25T18:48:04Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Depending on the implementation, the echo command may\nsupport options like -n -e -E or no options at all.\n\nThe only portable usage of echo is without any options,\nwhich means that no parameter may start with a hyphen.\n\ncheck-non-portable-shell.pl checks if echo -n is used.\nImprove it to reject any parameter starting with a hyphen\nand recommend the usage of printf instead\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/check-non-portable-shell.pl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl\nindex 8b5a71d..ff87611 100755\n--- a/t/check-non-portable-shell.pl\n+++ b/t/check-non-portable-shell.pl\n@@ -17,7 +17,7 @@ sub err {\n while (<>) {\n \tchomp;\n \t/^\\s*sed\\s+-i/ and err 'sed -i is not portable';\n-\t/^\\s*echo\\s+-n/ and err 'echo -n is not portable (please use printf)';\n+\t/^\\s*echo\\s+-(\\S)\\s+/ and err \"echo -$1 is not portable (please use printf)\";\n \t/^\\s*declare\\s+/ and err 'arrays/declare not portable';\n \t/^\\s*[^#]\\s*which\\s/ and err 'which is not portable (please use type)';\n \t/test\\s+[^=]*==/ and err '\"test a == b\" is not portable (please use =)';\n-- \n1.8.2.1.614.g66d7af5\n"}]}