From: Marcel Telka Date: Fri, 17 May 2024 14:08:45 +0000 (+0200) Subject: t/t9902-completion.sh: backslashes in echo X-Git-Tag: v2.46.0-rc0~109^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba1dec3257c5c8eb7edb71a16e5f642bf51d895d;p=thirdparty%2Fgit.git t/t9902-completion.sh: backslashes in echo 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 963f865f27..ed3d03367e 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -73,7 +73,7 @@ _get_comp_words_by_ref () print_comp () { local IFS=$'\n' - echo "${COMPREPLY[*]}" > out + printf '%s\n' "${COMPREPLY[*]}" > out } run_completion ()