How to execute one script from another script?

Hi,
I have a basic question regarding scripting.
I want to execute one script(child script) from another script(master script) and pass some values as well.

There are certain function present in master script that i want to use or call from child script. What all thinsg should i keep in mind while doing that?
In C , we use "include". Do we need to include the master script in the child script? if yes how?
How should i call function present in master script from child script?

use source command:
source (shild sript)
. (shild sript)

Please use the CODE tags, its even available in quick reply.

Syntax:

[source|.] [/path/to/]file

Examples:

. file_in_same_dir
source /this/is/somewhere/else_script
source "$VAR_WITH_SCRIPT"

However, to actualy execute a script, one usualy uses sh for bash scripts.
If you use another shell for your scripts, you could verify the $SHELL variable inside your caller/mother script contains the proper value, and then simply execute another script of the same shell with this:

$SHELL /path/to/script

Of course, the files should contain a so called shebang, that is #!/bin/bash for a bash script.
And if the script has the execution flag, you dont even need to call it using a shell command, just invoke the script as 'path'.

/path/to/script_with_exe_flag
#   OR
./subdir_of_pwd/script_or_bin

Also note, that if you execute a script, you can pass arguments (if the script is designed to handle it), which IMHO should be prefered, but might depend on situation/usage.

Hope this helps

Although it's an option, I'd recommend not executing a shell script with sh < myscript because disables all reading from the standard input (stdin) within the script.

K.

-- Apologies, I've just edited my comment because I've found a typo. I've just corrected it.