Suppose there are three sh scripts, A, B, and C. If they are to be executed sequentially, there are many ways. Some people recommend sleep, which is logically problematic. Because of abnormal conditions, sleep is useless. Some people recommend using the form of semaphore triggering, which is more advanced and requires solid knowledge of shell programming, and other forms can be considered for the usual small functions.
Assuming A, which executes B and C, the form is still passed through
sh B.sh
sh C.sh
form. However, if there is a third-party function command called in B (configured in the environment variable), there will be inexplicable problems.
The solution at that time was to redirect the execution result of B to a certain directory file:
sh B.sh >>/root/test/1.log
Then there is no problem.