I personally think that there are two ways to call the function of the script: one is to fix the function directly in the script in advance, and the other is to call the function by parameter, and call the function name as the parameter.
The first type of function is fixed and not flexible.
The second type is to call a function by passing parameters. This method is more flexible.
Passing parameters is substituted as follows. $1 is actually parameter 1, which is the name of the function
so that it can be called very flexibly. But you will find a problem, that is, if you write a lot of methods later, you must add logic code in the case to call the method,
so you need to
verify the script optimization results. In
this case, no matter how many method names I have, I can do it. transfer
Skills of Flexible Calling Functions of Shell Scripts
Guess you like
Origin blog.51cto.com/14483703/2595336
Ranking