title: Linux: Calling a function within a case
body: <p>I am trying to set up a menu system where on selection it runs a function. In my case is runs the 'testfunc' function. However is it fails giving the error; testfunc: command not found.</p>
  
  <p>My case statement looks like this;</p>
  
  <pre><code>case "$mainMenuInput" in
     1)testfunc ;;
  esac
  
  function testfunc{
      echo "This is a test"
  }
  </code></pre>
  
  <p>Thanks in advance.</p>