I wish to have long and short forms of command line options invoked using my shell script. I know that getopts can be used, but like in Perl, I have not been able to do the same with shell. Any ideas on how this can be done, so that i can use options like:
In the above, both the commands mean the same thing to my shell, but using, getopts, I have not been able to implement these?
| ||||
feedback |
49 | The bash getopts builtin does not support long option names with the double-dash prefix. It only supports single-character options.There is a shell tool getopt which is another program, not a bash builtin. The GNU implementation ofgetopt (e.g. on Linux) supports parsing long options.But the BSD implementation of getopt (e.g. on Mac OS X) does not. |
'via Blog this'
No comments:
Post a Comment