if statement - How to use options in bash for skipping parts of code -


I have a bidding script and I want to be able to leave it (which - is not executed) / P>

To make it clear what I want to accomplish, I have given the statement if which basically fulfills the same thing.

 <["$ 1"! = "SkipB"] then ["$ 1"!] = "SkipC"] then "" 1 "C" Fi if ["$ 1"! = "SkipD"] then "D" file resonance   

no arguments are passed when using the script, then executing all four echo statements Are there. If I want to leave one of those echo statements, then I use the skipLETTER as the first code:

 . All letters are printed except /script.sh skipA   

and A . It works, but it has many limitations - for one, I can not leave many parts using the same logic ( $ 1 ). I want to achieve the same thing with the options, so I can write something like this:

  ./ script - skipA -skipD   

And as a result, print only B and C letters.

I know I can use the getopt or getopts to get it, but I can not find any simple usage example I've received.

I code with the following algorithm:

  1. All in file 1 Capture executable codes
  2. Call each function according to logic in file 2
  3. When calling File 2, each call will be limited to one liner and the steps
  4. Call file 2 with the option of skipping
  5. If the steps to read lines as a statement If the next step will continue, then the steps and check of the current phase are less than the required stage. And use eval to work for it.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -