title: Find all ancestors and children of a process
body: <p>I need to write a recursive function that will take a PID and find its parent, ancestors, and children. I wrote this, but it doesn't seem to work.</p>
  
  <p>This function is only for the ancestors of the process that the user input.</p>
  
  <pre><code>findFather(){
  if [ $1 -ne 1 ]; then
     pid=$1
     ppid=ps -ef | awk '$pid == $2'
     findFather $ppid
     echo $ppid
  fi
  
  findFather $1
  </code></pre>