Reviewing the selftest I recently submitted, I realize that the second part

of it uses my old hack to get the PID of the spawned background tasks,
 which doesn't work for all shells, instead of the common use of $!.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXQ0kpAAoJEKKk/i67LK/8mcgH/jIV2N0iHDVO06Vk0xT/deaq
 9wr4l9WW363E/Hovh709fMPipw9tWHDTwF/rGyvozIEp6CV0zB9aH0PjJ3jVkiPV
 eM3Yz9rQtP8eADdI0nah7BIq2UIaORpngC8gjlKc86Vrd+5CAd4T3xwiW9Tye+vp
 X6BngeGYeXth3HmFjHCHYTU+TM/DnJ/KyaFuurDo3tjXCmKryWuVyHCzsgN/OeYP
 RbQheY5AKZKdf5Q3jB6mKof9ZoKhuycwxvDAMVnCY2g4dZmN9EXHwEh/iNnGa41O
 jbpxfjqEgsE4wi3Mnx4Lkbzh5w5uY99MyeeqhwnrwBF2R2aMumtSqs55l1f8eyw=
 =Do4q
 -----END PGP SIGNATURE-----

Merge tag 'trace-v4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fix from Steven Rostedt:
 "Reviewing the selftest I recently submitted, I realize that the second
  part of it uses my old hack to get the PID of the spawned background
  tasks, which doesn't work for all shells, instead of the common use of
  $!"

* tag 'trace-v4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ftracetest: Use proper logic to find process PID
This commit is contained in:
Linus Torvalds 2016-05-23 19:30:30 -07:00
commit 4496a1d963
1 changed files with 5 additions and 10 deletions

View File

@ -92,28 +92,23 @@ instance_slam() {
}
instance_slam &
x=`jobs -l`
p1=`echo $x | cut -d' ' -f2`
p1=$!
echo $p1
instance_slam &
x=`jobs -l | tail -1`
p2=`echo $x | cut -d' ' -f2`
p2=$!
echo $p2
instance_slam &
x=`jobs -l | tail -1`
p3=`echo $x | cut -d' ' -f2`
p3=$!
echo $p3
instance_slam &
x=`jobs -l | tail -1`
p4=`echo $x | cut -d' ' -f2`
p4=$!
echo $p4
instance_slam &
x=`jobs -l | tail -1`
p5=`echo $x | cut -d' ' -f2`
p5=$!
echo $p5
ls -lR >/dev/null