Hello Tavian,
> See https://savannah.gnu.org/bugs/?15235 for a discussion of why the
> POSIX wording implies that "-" by itself is not part of the expression.
I think this was a pedantly wrong interpretation of the standard.
The specification has been reworded since to prevent this:
“The first operand and subsequent operands up to but not including the
first operand that starts with a '-', or is a '!' or a '(', shall be
interpreted as path operands.”
“If the first operand starts with a '-', or is a '!' or a '(', the
behavior is unspecified”
So no, POSIX doesn't say (or imply) that "-" is to be treated as a path.
The implementation is free to chose, then you can't expect
compatibility there and shouldn't rely on that.
Received on Fri Nov 02 2018 - 09:21:50 CET