git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t/t9902-completion.sh: backslashes in echo
@ 2024-05-17 14:08 Marcel Telka
  2024-05-23 17:59 ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Marcel Telka @ 2024-05-17 14:08 UTC (permalink / raw)
  To: git

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>
---
 t/t9902-completion.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 ()

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-05-23 23:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17 14:08 [PATCH] t/t9902-completion.sh: backslashes in echo Marcel Telka
2024-05-23 17:59 ` Junio C Hamano
2024-05-23 20:31   ` Marcel Telka
2024-05-23 21:06     ` Eric Sunshine
2024-05-23 21:47       ` Marcel Telka
2024-05-23 22:39         ` Marcel Telka
2024-05-23 22:45           ` Marcel Telka
2024-05-23 23:03           ` Junio C Hamano
2024-05-23 23:14             ` Eric Sunshine
2024-05-23 23:21             ` Marcel Telka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).