#1036245 “Any arguments after the -- are treated as filenames and arguments.” in the bash man page makes no sense the way stated

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Al Ma
Date:
2023-05-18 23:33:04 UTC
Severity:
normal
#1036245#5
Date:
2023-05-17 23:53:55 UTC
From:
To:
Package: bash
Version: 5.1-2+deb11u1
In the man page for bash we see the line,
“-- A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as filenames and arguments. An argument of - is equivalent to --.”
I claim that the sentence “Any arguments after the -- are treated as filenames and arguments.” is strange and should be rewritten or dropped.
I see two main logical interpretations of this sentence:
(1) *For each argument 𝑥 after --, 𝑥 is treated as a filename and an argument simultaneously.* This can be expressed more succinctly without any loss of information: *For each argument 𝑥 after --, 𝑥 is treated as a filename.* This implies the original formulation as follows. Take any 𝑥 after --. By the succinct formulation, 𝑥 is treated as a filename. By assumption, 𝑥 is an argument. By default (as this has not been stated otherwise for the option --), arguments are also treated as arguments, so 𝑥 is also treated as an argument. Together, 𝑥 is treated as a filename and an argument. Q.E.D.
(2) *For each argument 𝑥 after --, 𝑥 is treated as a filename, or 𝑥 is treated as an argument.* This is a tautology, which you see as follows. Take any 𝑥 after --. By default (as this has not been stated otherwise  for the option --), arguments are also treated as arguments, so 𝑥 is treated as an argument. Therefore, 〈any claim〉 or 𝑥 is treated as an or argument. The term 〈any claim〉 can be arbitrary; in particular, *𝑥 is treated as a filename* would do. Q.E.D.
Summarizing, in case (1) the sentence can be shortened and in case (2) the sentence can be dropped, both without loss of information. Of course, assuming that the authors of the document really wish to say what they are saying.
We ask for the description of `--` to be rewritten clearly and succinctly.
Gratefully,
AlMa

#1036245#10
Date:
2023-05-18 19:44:37 UTC
From:
To:
I suggest the confusion is because the "argument" at the end is described
as both an argument and also...not an argument. i the first is a bit
redundant.

i suggest including an example, such as:


A `--' (or a single `-') stops bash interpreting further arguments as
options. Any arguments after the `--' are treated as a new command line
that bash will run. For example, 'bash -- ls --help' passes the `--help' to
ls rather than bash.

#1036245#15
Date:
2023-05-18 19:44:37 UTC
From:
To:
I suggest the confusion is because the "argument" at the end is described
as both an argument and also...not an argument. i the first is a bit
redundant.

i suggest including an example, such as:


A `--' (or a single `-') stops bash interpreting further arguments as
options. Any arguments after the `--' are treated as a new command line
that bash will run. For example, 'bash -- ls --help' passes the `--help' to
ls rather than bash.

#1036245#20
Date:
2023-05-18 23:28:09 UTC
From:
To:
Thanks! First, if the arguments `-' and `--' are absolutely equivalent, there's no need for parens (which make the stuff inside the parens, well, parenthetic). Second, pay attention to the consistency of the quotation marks, whichever you choose. Therefore:
A single argument `--' or `-' stops bash interpreting further arguments as its own options. Any arguments after the `--' or `-' are treated as a new command line that bash will run. For example, `bash -- ls --help' passes the `--help' to `ls' rather than bash.
However, there's a problem:
$ bash -- ls --help
/usr/bin/ls: /usr/bin/ls: cannot execute binary file
AlMa

#1036245#25
Date:
2023-05-18 23:28:09 UTC
From:
To:
Thanks! First, if the arguments `-' and `--' are absolutely equivalent, there's no need for parens (which make the stuff inside the parens, well, parenthetic). Second, pay attention to the consistency of the quotation marks, whichever you choose. Therefore:
A single argument `--' or `-' stops bash interpreting further arguments as its own options. Any arguments after the `--' or `-' are treated as a new command line that bash will run. For example, `bash -- ls --help' passes the `--help' to `ls' rather than bash.
However, there's a problem:
$ bash -- ls --help
/usr/bin/ls: /usr/bin/ls: cannot execute binary file
AlMa