From: Marcel Telka <marcel@telka.sk>
To: git@vger.kernel.org
Subject: [PATCH] t/t9902-completion.sh: backslashes in echo
Date: Fri, 17 May 2024 16:08:45 +0200 [thread overview]
Message-ID: <Zkdk7R9GIfsyQjkc@telcontar> (raw)
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 ()
next reply other threads:[~2024-05-17 14:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 14:08 Marcel Telka [this message]
2024-05-23 17:59 ` [PATCH] t/t9902-completion.sh: backslashes in echo 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zkdk7R9GIfsyQjkc@telcontar \
--to=marcel@telka.sk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).