Is it possible to ignore unknown optional arguments with GNU getopt?
I have a script, scriptA.sh that takes the optional arguments --optA, --optB, --optC, --optD .
I would like to write wrapper, wrapperA, with two optional arguments, --optX and --optY , which calls scriptA . However, I do not want to declare all optional scriptA parameters inside the shell.
In particular, if inside wrapperA , I specify optional arguments with
getopt --longoptions optX:,optY:
call
wrapperA --optX --optA --optB
returns an error
getopt: unknown option -- optA
Is it possible to get GNU getopt to ignore unknown arguments and put them after '-' in its output?
linux bash getopt
user3830744
source share