How do you pass an argument to a function in shell script?

How do you pass an argument to a function in shell script?
Answer
To invoke a function, simply use the function name as a command. To pass parameters to the function,
add space separated arguments like other commands. The passed parameters can be accessed inside the function using the standard positional variables i.e. $0, $1, $2, $3 etc.
 

Tìm kiếm

Back
Top