meetramana
Programmer
is there any way to do the following using getopts in korn shell ?
myscript.ksh -input inputfilename -ouput outfilename
instead of
myscript.ksh -i inputfilename -o outfilename
where inputfilename and outfilename are the real filename and the rest are flags except the scriptname.
The above is just an example of what I am trying to do
I know it can be done through if and shift operators, but I like the getopts validation. SUN operating system accommodates something like with long flags such as
getopts "iinput)" arguments
.....
but that requires to be invoked as
myscript.ksh --input inputfiles ....
not
myscript.ksh -input inputfile
myscript.ksh -input inputfilename -ouput outfilename
instead of
myscript.ksh -i inputfilename -o outfilename
where inputfilename and outfilename are the real filename and the rest are flags except the scriptname.
The above is just an example of what I am trying to do
I know it can be done through if and shift operators, but I like the getopts validation. SUN operating system accommodates something like with long flags such as
getopts "iinput)" arguments
.....
but that requires to be invoked as
myscript.ksh --input inputfiles ....
not
myscript.ksh -input inputfile