]> Kevux Git Server - rit/commitdiff
t/t9902-completion.sh: backslashes in echo
authorMarcel Telka <marcel@telka.sk>
Fri, 17 May 2024 14:08:45 +0000 (16:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 19:13:26 +0000 (12:13 -0700)
The usage of backslashes in echo is not portable.  Since some tests
tries to output strings containing '\b' it is safer to use printf
here.  The usage of printf instead of echo is also preferred by POSIX.

Signed-off-by: Marcel Telka <marcel@telka.sk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9902-completion.sh

index 963f865..ed3d033 100755 (executable)
@@ -73,7 +73,7 @@ _get_comp_words_by_ref ()
 print_comp ()
 {
        local IFS=$'\n'
-       echo "${COMPREPLY[*]}" > out
+       printf '%s\n' "${COMPREPLY[*]}" > out
 }
 
 run_completion ()