title: load the functions of a shell script without executing it
body: <p>I have a shell script which does some functions like making image , downloading tar files,exporting environment variables,download images ...n task etc. I have separate functions for each task. I If I source the shell script it will start running functions one by one. Is there a way to make the functions available to shell without executing it.
  Sourcing the shell script will make the function available to shell but it will start executing it.</p>
  
  <p>Actual code:</p>
  
  <pre><code>     do_task1();
       #some logging here 
       #shell commands  
       do_task2(); 
       #error checks
       #....
       # there are lot of such things as well as user defined functions.
  </code></pre>
  
  <p>Sourcing this file will actually start executing this since the call to functions exist. I want the user defined functions alone to be available in shell prompt.</p>
  
  <p>One way is to use C style coding ie to have main function which will call other functions. Whenever I want the functions alone to be available in a shell without exec then I could just comment that main call alone. Right now I don't have main function.</p>
  
  <pre><code>  function main()
    {
     do_task1();
      #add all the commands and functions here.
     do_task2();
    }
  main # I can comment this.
  </code></pre>
  
  <p>Is there any other way(or some shell command)to load the functions alone ?</p>
  
  <p>Why I need this ?
   It will be useful for debugging .
   If I want to run some functions of this shell script I can just run it .</p>