The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-26-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,748
One way:
put your reusable function code in a separate file, let's call in MY_INCLUDE
Code:
#!/bin/ksh
# myscript.sh
# include the functions
. /path/to/MY_INCLUDE
# your main code goes here
...............
exit 0
We have several of these function include files that are used by dozens of scripts, throughout all of our major app.