I'm using getopts to deal with parameters. I need to have an option that has to be always executed last. Let's say i have option a,b,c,d,e, I need e to always be last. How would I do that?
Asked
Active
Viewed 18 times
0
-
set a flag and check it in the other options – 123 Sep 25 '17 at 15:03
-
I don't know about flags. Could you give me an example? – Max Sep 25 '17 at 15:08
-
under `e` do `lastopt=1`, check for that value in the other options, if it is set, then do whatever. – 123 Sep 25 '17 at 15:11