From the Bash POSIX Mode reference I would expect the behaviour you're seeing - it doesn't say anywhere on that list that history numbers (outside of PS1
and PS2
expansions) will be treated differently with posix
set. Also, since others said it was not a bug I guess the meaning of "superset" is that as long as no Bash-specific settings are in place the shell will behave according to the POSIX standard.
Interestingly, even if you run bash --noprofile --norc --posix
some Bash-specific settings are on by default:
bash-4.2$ set -o | grep 'on$'
braceexpand on
emacs on
hashall on
histexpand on
history on
interactive-comments on
monitor on
posix on
None of these are mentioned in the POSIX Shell Command Language documentation (I looked up their shorthands in man bash
first), and interactive-comments
is not mentioned anywhere.