Does ksh93 support +o type options with its getopts(1) builtin?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
ksh93 supports long options the same way as introduced by Sun Microsystems in Spring 2004 for getopt(3)
, Bourne Shell
and ksh88
.
You may e.g. use:
getopt(argc, argv, "V(version)");
to establish a long --version
alias to the short option -V
.
However ksh93
does not use the getopt(3)
from Solaris libc but an own implementation that internally is used to support short options that start with a +
sign.
Is there a way to use this feature with the ksh93
builtin getopts(1)
implementation and iff, how does it work?
ksh
add a comment |
up vote
1
down vote
favorite
ksh93 supports long options the same way as introduced by Sun Microsystems in Spring 2004 for getopt(3)
, Bourne Shell
and ksh88
.
You may e.g. use:
getopt(argc, argv, "V(version)");
to establish a long --version
alias to the short option -V
.
However ksh93
does not use the getopt(3)
from Solaris libc but an own implementation that internally is used to support short options that start with a +
sign.
Is there a way to use this feature with the ksh93
builtin getopts(1)
implementation and iff, how does it work?
ksh
1
Trygetopts --man 2>&1 | more
in ksh93 for details.
– Stéphane Chazelas
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for--help
IIRC. Do you know examples for this+o
feature?
– schily
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
ksh93 supports long options the same way as introduced by Sun Microsystems in Spring 2004 for getopt(3)
, Bourne Shell
and ksh88
.
You may e.g. use:
getopt(argc, argv, "V(version)");
to establish a long --version
alias to the short option -V
.
However ksh93
does not use the getopt(3)
from Solaris libc but an own implementation that internally is used to support short options that start with a +
sign.
Is there a way to use this feature with the ksh93
builtin getopts(1)
implementation and iff, how does it work?
ksh
ksh93 supports long options the same way as introduced by Sun Microsystems in Spring 2004 for getopt(3)
, Bourne Shell
and ksh88
.
You may e.g. use:
getopt(argc, argv, "V(version)");
to establish a long --version
alias to the short option -V
.
However ksh93
does not use the getopt(3)
from Solaris libc but an own implementation that internally is used to support short options that start with a +
sign.
Is there a way to use this feature with the ksh93
builtin getopts(1)
implementation and iff, how does it work?
ksh
ksh
edited 2 days ago
Stéphane Chazelas
293k54550891
293k54550891
asked 2 days ago
schily
10.5k31641
10.5k31641
1
Trygetopts --man 2>&1 | more
in ksh93 for details.
– Stéphane Chazelas
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for--help
IIRC. Do you know examples for this+o
feature?
– schily
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago
add a comment |
1
Trygetopts --man 2>&1 | more
in ksh93 for details.
– Stéphane Chazelas
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for--help
IIRC. Do you know examples for this+o
feature?
– schily
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago
1
1
Try
getopts --man 2>&1 | more
in ksh93 for details.– Stéphane Chazelas
2 days ago
Try
getopts --man 2>&1 | more
in ksh93 for details.– Stéphane Chazelas
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for
--help
IIRC. Do you know examples for this +o
feature?– schily
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for
--help
IIRC. Do you know examples for this +o
feature?– schily
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482119%2fdoes-ksh93-support-o-type-options-with-its-getopts1-builtin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Try
getopts --man 2>&1 | more
in ksh93 for details.– Stéphane Chazelas
2 days ago
I discovered this some time ago already, I however have been unable to understand it since there are no examples and the ksh concept seems to complex as it includes support for
--help
IIRC. Do you know examples for this+o
feature?– schily
2 days ago
Yes, by brain is not tuned to parse that man page either. There are plenty of examples in the ast-open source code though.
– Stéphane Chazelas
2 days ago