[lttng-dev] [PATCH lttng-modules] Remove bashism in lttng-syscalls-generate-headers.sh

Jon Bernard jbernard at tuxion.com
Mon May 13 10:33:18 EDT 2013


Options to echo are not portable. In particular, the 'echo -e' option is
implemented by some shells, including bash, to expand escape sequences. However,
dash is one of the other family of shells that instead expands escape sequences
by default.

The printf command is portable and much more reliable.
---
 instrumentation/syscalls/lttng-syscalls-generate-headers.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh
index 046dc06..1754ae8 100755
--- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh
+++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh
@@ -59,7 +59,7 @@ if [ "$CLASS" = integers ]; then
 
 NRARGS=0
 
-echo -e \
+printf \
 'SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs,\n'\
 '	TP_STRUCT__entry(),\n'\
 '	TP_fast_assign(),\n'\
-- 
1.7.10.4


-- 
Jon



More information about the lttng-dev mailing list