aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-10-08 22:40:58 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-10-10 05:25:00 +0200
commitb40880c157ea12ccfc93266cc08252be1aaedaa9 (patch)
treeb26801f67df3751a35564bbeba9c41d7f8b9a27a
parentff63ac922a4017de8a5d384b1c0be36433436ed8 (diff)
downloadpasst-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar.gz
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar.bz2
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar.lz
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar.xz
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.tar.zst
passt-b40880c157ea12ccfc93266cc08252be1aaedaa9.zip
test/lib/term: Always use printf for messages with escape sequences
...instead of echo: otherwise, bash won't handle escape sequences we use to colour messages (and 'echo -e' is not specified by POSIX). Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-xtest/lib/term8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lib/term b/test/lib/term
index 0fa0936..fcbed16 100755
--- a/test/lib/term
+++ b/test/lib/term
@@ -31,8 +31,8 @@ PR_DELAY_INIT=100 # ms
# $@: Message to print
info() {
tmux select-pane -t ${PANE_INFO}
- echo "${@}" >> $STATEBASE/log_pipe
- echo "${@}" >> "${LOGFILE}"
+ printf "${@}\n" >> $STATEBASE/log_pipe
+ printf "${@}\n" >> "${LOGFILE}"
}
# info_n() - Highlight, print message to pane and to log file without newline
@@ -47,13 +47,13 @@ info_n() {
# $@: Message to print
info_nolog() {
tmux select-pane -t ${PANE_INFO}
- echo "${@}" >> $STATEBASE/log_pipe
+ printf "${@}\n" >> $STATEBASE/log_pipe
}
# info_nolog() - Print message to log file
# $@: Message to print
log() {
- echo "${@}" >> "${LOGFILE}"
+ printf "${@}\n" >> "${LOGFILE}"
}
# info_nolog_n() - Send message to pane without highlighting it, without newline