wait-parent.sh 198 B

123456789101112
  1. #!/bin/sh --
  2. # wait for parent to finish from child
  3. set -vxue
  4. ppid="${$}" # save parent pid
  5. ( # child porcess
  6. ./pd "${ppid}"
  7. echo "parent finished"
  8. ) & # spawn child in background
  9. exec sleep 10