title: Shell script that checks every X seconds if PID is running
body: <p>I must create a Shell script that checks every X seconds if a PID (process identifier) is running or not. It must run with this terminal command:</p>
  
  <p>$ script [PID] [SECONDS]</p>
  
  <p>I wrote this, but it doesn't work:</p>
  
  <pre><code>#!/bin/bash
  
  read -a PID
  read -a SECONDS
  
  while(true)
  
      if [kill -s 0 $PID]
          then
              echo "PID $PID is running"
          exit 0;
      else
              echo "PID $PID is not running"
  
  sleep $SECONDS
  </code></pre>
  
  <p>can someone tell me where the problem is?</p>