On 2021-10-30 14:33:04 +0100, Stephane Chazelas via austin-group-l at The Open 
Group wrote:
> POSIX ended up mandating that bug (mandating that system("+c")
> should run an interactive shell for instance), because, like the
> the Unix libc implementors, they overlooked the issue. It is
> clearly a bug in the standard.

It doesn't mandate that system("+c") should run an interactive shell.

With dash:

$ sh -c +c
sh: 0: -c requires an argument

Ditto with bash:

$ bash -c +c
bash: -c: option requires an argument

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".

Or perhaps "+c" can be seen as a command to run an interactive shell,
a bit like "sh -c sh", in which case I do not see any issue (the user
may also have a command "+c" that runs sh in his path, in which case
adding "--" would not change the ksh behavior).

-- 
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)

  • Re: Interpretation ... Robert Elz via austin-group-l at The Open Group
    • Re: Interpreta... shwaresyst via austin-group-l at The Open Group
    • Re: Interpreta... Robert Elz via austin-group-l at The Open Group
      • Re: Interp... Nick Stoughton via austin-group-l at The Open Group
      • Re: Interp... Robert Elz via austin-group-l at The Open Group
        • Re: In... Eric Blake via austin-group-l at The Open Group
        • Re: In... Robert Elz via austin-group-l at The Open Group
          • Re... Steffen Nurpmeso via austin-group-l at The Open Group
          • Re... Robert Elz via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
              • ... Vincent Lefevre via austin-group-l at The Open Group
              • ... Stephane Chazelas via austin-group-l at The Open Group
              • ... Vincent Lefevre via austin-group-l at The Open Group
            • ... Steffen Nurpmeso via austin-group-l at The Open Group
          • Re... Geoff Clare via austin-group-l at The Open Group
    • Re: Interpreta... Steffen Nurpmeso via austin-group-l at The Open Group
    • Re: Interpreta... Robert Elz via austin-group-l at The Open Group

Reply via email to