Hi,
Does anyone have an example of parsing command line arguments similar to how getopts parse command line arguments?
I am looking at a getopts alternative because I want to have the same parsing on the subroutine/function in the script.
For example, I want to be able to do test.ksh -p 1 -d /tmp but inside the script I want to be able to do do a sub1 -u test01 -o remove.
By using an alternative to getopts, it won't be confusing understanding how I parse argument either from the script or from the subroutines/functions.
Any advice much appreciated. Thanks in advance.
Does anyone have an example of parsing command line arguments similar to how getopts parse command line arguments?
I am looking at a getopts alternative because I want to have the same parsing on the subroutine/function in the script.
For example, I want to be able to do test.ksh -p 1 -d /tmp but inside the script I want to be able to do do a sub1 -u test01 -o remove.
By using an alternative to getopts, it won't be confusing understanding how I parse argument either from the script or from the subroutines/functions.
Any advice much appreciated. Thanks in advance.