I attempted to answer a question a couple hours ago which I believed revealed a somewhat obscure bug in bash POSIX mode. I was hastily and vehemently told this was not so. The contradicting answer, which explicitly says this is not a bug, was selected as the correct answer.
So I've been combing over the bash documentation, and I'm still coming away with very much the same impression, so I thought I should ask.
My (alleged) bug:
set -o histexpand
(which is typically implicit)
set -o posix
echo "#!/"
Should, well, echo #!/
. (It does in any other shell). But in bash it instead
prints to standard output
!/: event not found
And then returns 0.
So it would seem to me that bash's implicit set -o histexpand
is in rare cases in contravention of the POSIX standard, and does not make way for set -o posix
.
The documentation for set -o posix
reads:
Change the behavior of Bash where the default operation differs from the POSIX standard ... This is intended to make Bash behave as a strict superset of that standard.
And I've always thought that this meant that this option should supersede other set
options when they contradict?
This doesn't appear to be one of the 48 enumerated differences either.
Is this not the case? What am I missing?