提交 9a154c89 编写于 作者: S Steven Rostedt

ftracetest: Fix instance test to use proper shell command for pids

The ftracetest instance test used parsing of the "jobs" output to find the
pid of the subshell that is executed previously. But this is not portable to
all major shells that may run these tests. The proper way to get the pid of
the subshell is the shell command "$!". This will return the pid of the
previously executed command. Use that instead, otherwise the test does not
work in all environments.

Link: http://lkml.kernel.org/r/20151211143617.65f4d7a1@gandalf.local.homeReported-by: NMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 b33c8ff4
...@@ -39,28 +39,23 @@ instance_slam() { ...@@ -39,28 +39,23 @@ instance_slam() {
} }
instance_slam & instance_slam &
x=`jobs -l` p1=$!
p1=`echo $x | cut -d' ' -f2`
echo $p1 echo $p1
instance_slam & instance_slam &
x=`jobs -l | tail -1` p2=$!
p2=`echo $x | cut -d' ' -f2`
echo $p2 echo $p2
instance_slam & instance_slam &
x=`jobs -l | tail -1` p3=$!
p3=`echo $x | cut -d' ' -f2`
echo $p3 echo $p3
instance_slam & instance_slam &
x=`jobs -l | tail -1` p4=$!
p4=`echo $x | cut -d' ' -f2`
echo $p4 echo $p4
instance_slam & instance_slam &
x=`jobs -l | tail -1` p5=$!
p5=`echo $x | cut -d' ' -f2`
echo $p5 echo $p5
ls -lR >/dev/null ls -lR >/dev/null
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册