title: A shell script (.sh) that calls an infinite loop called by another script to run in the background
body: <p>Essentially what is happening is I'm operating on a limited instruction set framework (to run on an embedded device). The idea is very simple.</p>
  
  <p>I call a script which makes two files:</p>
  
  <ul>
  <li>file A: start_up - which calls the infinite loop</li>
  <li>file B: background_while - which repeats a process over again</li>
  </ul>
  
  <p><strong>contents of file A:</strong></p>
  
  <pre><code>#!/bin/sh
  sh background_while&amp;
  </code></pre>
  
  <p><strong>contents of file B:</strong></p>
  
  <pre><code>#!/bin/sh
  
  while true
  do
   #some commands
   sleep 5
  done
  </code></pre>
  
  <p>I would like to terminate this process called in the background. Could someone show how this is best done using a keyboard interrupt?</p>