unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/1] test: unset 'xpg_echo' bash shell option
@ 2013-08-20 16:16 Tomi Ollila
  2013-09-05 13:20 ` Vladimir Marek
  2013-09-09  1:54 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Tomi Ollila @ 2013-08-20 16:16 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

When 'xpg_echo' bash shell option is unset (usually the default)
echo builtin does not expand backslash-escape sequences by default
(i.e. '\n' is echoed as '\n' instead of newline). Not all bash
installations have this feature we depend on activated by default.

Note that the feature is bash (and GNU /bin/echo) specific. It is used
as it is convenient. If portability is needed (elsewhere) use printf(1)
(also often available as a shell builtin).
---
 test/test-lib.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index ffab1bb..d3a8c58 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -22,6 +22,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
     exit 1
 fi
 
+# Make sure echo builtin does not expand backslash-escape sequences by default.
+shopt -u xpg_echo
+
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
 case "$GIT_TEST_TEE_STARTED, $* " in
-- 
1.8.0

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

end of thread, other threads:[~2013-09-09  1:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 16:16 [PATCH 1/1] test: unset 'xpg_echo' bash shell option Tomi Ollila
2013-09-05 13:20 ` Vladimir Marek
2013-09-09  1:54 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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