shell sequential execution

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.

 

Guess you like

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