Comment by akovaski

6 days ago

> I can't reproduce this in Python (including my local 2.7 build), only using sh directly.

Same for me. It looks like the POSIX folks accepted the author's suggestion in 2022 and system() in glibc was updated in 2023.

https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps...

  #include <stdlib.h>
  int main(void) {
      system("-x");
      return 0;
  }

...

> [pid 172293] execve("/bin/sh", ["sh", "-c", "--", "-x"], 0x7ffe221d2f58 /* 76 vars */) = 0