Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Linux system reports that the required numerical parameters are wrong. What is the reason?
Linux system reports that the required numerical parameters are wrong. What is the reason?
The return value of a Shell function can only be an integer value, which is generally used to indicate whether the function was executed successfully, with 0 indicating success and other values indicating failure. Therefore, it is not appropriate to use the function return value to return the function execution result. If you want to suddenly return a calculation result, such as a string, you will often get an error prompt: "numeric.

Parameter is required.

If a function must return one or more values, you can define a global variable, and the function assigns the calculation result to the global variable, and then other places in the script can obtain one or more execution results "returned" by that function by accessing the global variable.