On 2021-11-03 16:41:40 +0000, Stephane Chazelas via austin-group-l at The Open Group wrote: > 2021-11-03 17:06:07 +0100, Vincent Lefevre via austin-group-l at The Open > Group: > [...] > > ksh93 and mksh run an interactive shell, but I wonder whether this > > should be regarded as a bug. > > > > The sh utility has the following in SYNOPSIS: > > > > sh −c [−abCefhimnuvx] [−o option]... [+abCefhimnuvx] [+o option]... > > command_string [command_name [argument...]] > > > > i.e. "+c" doesn't seem to be allowed to "cancel" the "-c". > [...] > > I can't see why that wouldn't be allowed as an extension. > > Just like bash's > > sh -c +O xpg_echo 'echo -e "\b\c"' > > would be allowed as an extension (and not be required to > interpret the +O script with xpg_echo in $0 and echo -e "\b\c" > in $1). > > As the -O / +O option is not among the options POSIX specifies.
Since options can take arguments, I think that this is OK. The question is whether extensions may change the usage described by the synopsis. 2.1.1 says "Additional options for standard utilities", so this would go beyond options. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)