How to call getopts in bash multiple times -


I have a general library that I use from several scripts which parses the command line option but I also want to I am capable of logic process as well as my personal script ... like

common.sh:

  function get_options {echo -e "in getoptions "$ OPOND echo during getopts": ab: "OptionName; Doing [... processing code ...] done}  

a.sh

 . ./common.sh function get_local_options {echo -e "getoptions" during "getopts echo $ OPcho": xy: "optionName; The problem is that if I call a.sh:  
  a.sh -x -y foo -a -b times  

get_options stop processing at "foo" because it was previously "non-option" Stops at

without re-writing things in any way around me?

  foo () {unset OPTIND while getopts ... do}  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -