Hi Liu,
On Wed, 29 Apr 2020 15:13:20 +0800 Liu Yiding yidingx.liu@intel.com wrote:
Hi, all.
I met a funny error when i run kprobe_syntax_errors
root@vm-snb-35 /usr/src/linux-selftests-x86_64-rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/ftrace# ./ftracetest -vvv test.d/kprobe/kprobe_syntax_errors.tc [snip] + expr 13 + 0 + test 13 -eq 13 + echo p:kprobes/testevent _do_fork abcd=\1 sh: echo: I/O error
This error only happend on dash, use bash run this test is ok.
backslash ('\1') will be transferred into empty in dash.
Oops, good catch! I found that came from the built-in echo command behavior. Bash's echo doesn't interpret the backslash escape, but dash's POSIX-compliant echo does.
----<dash>---- $ a='\1' $ b=`echo $a` $ test "$a" = "$b" && echo "same!" || echo "different" different
----<bash>---- $ a='\1' $ b=`echo $a` $ test "$a" = "$b" && echo "same!" || echo "different" same!
OK, I'll fix it.
Thank you!