return, exit 0 in shell script, and parent process to get the variable of child process

1 return and exit in shell script 0 
In shell script, the return statement is generally used in the function of the script. After the return statement is used in the function, it means that the function execution is completed, and the code after the return statement in the function will no longer be executed. At the same time, the script will Continue to execute the code after the function.

But exit 0, whether in a script or a function, will exit the entire shell script once it is used. 
2 The parent process obtains the variables of the child process
1. Execute the B script in the A script, you can let the B script exit strb, and then use 
$? in the A script to obtain the strb of the B script, so that it can be achieved, the parent process gets Process variables. 
2. Let the B script implement redirection, so that you can also get the variables of the child process

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326641273&siteId=291194637