[Bug 274650] sh does not accept -- after -c

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 22 Oct 2023 16:55:33 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274650

Benjamin Takacs <nimaje+fbz@bureaucracy.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nimaje+fbz@bureaucracy.de

--- Comment #1 from Benjamin Takacs <nimaje+fbz@bureaucracy.de> ---
FreeBSDs sh doesn't do any option parsing after -c, this makes accidents due to
an unusual nammed command impossible and lead to the behaviour you observe.

sh tries to run the command ´--´ and uses ´echo $0´ providing ´arg´ as
argument.
As you don't have any command named ´--´ on your system sh reports it with its
name ´echo $0´.

That is POSIX incompatiple behaviour. I'm in favour of documenting this
incompatibility and closing this report as ´Works As Intended´

-- 
You are receiving this mail because:
You are the assignee for the bug.