(1), the CSH script can call Bash's script, and vice versa.
(2). How to invoke variables and functions defined in other scripts.
(3). The variable defined, which defaults to a global variable. Local variables need to be specified locally to declare them. Column: Local value= "value",
The variable cannot be called in any other function or file.
(4). Execution is loaded (included)
L Example: the variable and function defined in test.sh are called in use.sh.
TEST.SH is defined as follows:
#!/bin/sh
function func
{
echo "The ARG is $"
Value= "$"
echo "Value=${value}"
}
Function Main
{
echo "--main Start---"
Func "Test"
echo "---main end---"
}
The following is the definition of main.sh
#!/bin/sh
source./test.sh # (or./test.sh), you need to indicate the path to the containing file---(4)
echo "---use Start---"
Main
echo "Call Value =${value}"
echo "---use End---"
---------------------
Execute main.sh (or sh-x main.sh)
You can see the call procedure.
Some summary of shell script usage