in reply to getopts and duplicit params

If I'm not mistaken, getopts handles this already.. the last variable offered will overwrite the one before.
In your example...

--input="input1" will be overwritten by "--input="input2"

In other words, only one parameter will be handed over.

Replies are listed 'Best First'.
Re^2: getopts and duplicit params
by Anonymous Monk on Mar 13, 2013 at 11:46 UTC
    That's exactly what I'm trying to avoid. I need to end the script rather than overwriting by the last appearance of the param.
      That goes against the general philosophy of running stuff from a shell command line and allowing users to customize their defaults. Users are free to set up aliases with their most commonly used flags and allowing duplicate flags / taking that last flag allows them to still access all the command line options. Flags for default options exist for this reason.