Passing parameters to a Bash function
There are two typical ways of declaring a function. I prefer the second approach. function function_name { command… } or function_name () { command… } To call a function with arguments: function_name “$arg1” “$arg2” The function refers to passed arguments by their position (not by name), that is $1, $2, and so forth. $0 is … Read more