Welcome to LQ.
You can define a function with:
Code:
#!/bin/bash
# This is "myfunction.sh"
myfunction() {
echo My Function
}
To load it in another script with:
Code:
#!/bin/bash
# This is "script.sh"
# Load the function
. /path/to/myfunction.sh
# Run the function
myfunction