skip execution of a function in a script.
Hello,
I have a bash script which is composed of different functions. I want to able to select which functions to be executed when i run the script, for that i thought about using a flag in the function. but i dont know how to skip the function whose flag is set to zero. any idea? or any other way to do this? I would appreciate much any help :) Code:
myfunc1(){ |
From what I understand, a function will only run if you call it. So, some decent if-then sections, or a 'case' section, and I'm sure there is something that can be done.
Code:
function one (){ |
As said before, you can choose to run particular functions, but one thing I haven't seen yet is how you pass which functions you want to run into the script. This is where command-line arguments come in. Taking the previous example and expanding on it...
Code:
function one (){ |
All times are GMT -5. The time now is 12:25 AM. |