title: Exit all called KornShell (ksh) scripts
body: <p>How can a KornShell (ksh) script exit/kill all the processes started from another ksh script?</p>
  
  <p>If scriptA.ksh calls scriptB.ksh then the following code works good enough, but is there a better solution for this?: </p>
  
  <p><strong>scriptA.ksh:</strong></p>
  
  <pre><code>#call scriptBSnippet
  scriptBSnippet.ksh ${a}
  </code></pre>
  
  <p><strong>scriptB.ksh:</strong></p>
  
  <pre><code>#if error: exit this script (scriptB) and calling script (scriptA)#
  kill ${PPID}
  exit 1
  </code></pre>
  
  <p>To add complexity what if scriptA calls scriptB which calls scriptC, then how to exit out of all three scripts if there is an error in scriptC?</p>
  
  <p><strong>scriptA.ksh:</strong></p>
  
  <pre><code>#call scriptBSnippet
  scriptBSnippet.ksh ${a}
  </code></pre>
  
  <p><strong>scriptB.ksh:</strong></p>
  
  <pre><code>#if error: exit this script (scriptB) and calling script (scriptA)#
  kill ${PPID}
  exit 1
  </code></pre>
  
  <p><strong>scriptC.ksh:</strong></p>
  
  <pre><code>#if error: exit this script (scriptC) and calling scripts (scriptA, scriptB)#
  #kill ${PPID}
  #exit 1
  </code></pre>
  
  <p>Thanks in advance.</p>