Re: [PATCH 8/8] check-whitespace: detect if no base_commit is provided
- From
- Georg Pfuetzenreuter <georg@syscid.com>
- Date
- Jul 8, 2024, 10:35 UTC
- Message-ID
- <d3921679-eeb8-4cca-bc0d-967e9e567fd4@syscid.com>
- In-Reply-To
- <CAPx1GvfkC0rv_8_q5_HfduhuKX4csO+sBZiZqV+Sh+Q0dV8+4w@mail.gmail.com>
On 7/8/24 12:18 PM, Chris Torek wrote:
Show 9 quoted lines
> The `test` command has AND and OR operators of its own, > which give `-a` (AND) higher precedence than `-o` (OR). In > addition, `$#` can only expand to an integer value, so quotes > are not required, and the whole thing can be written as: > > if test $# -ne 1 -a $# -ne 3 -o -z "$1" > > (which is what I would do myself, unless I wanted a separate > error message for an empty "$1"). It's fine as is though.
Hi,
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html states
"The XSI extensions specifying the -a and -o binary primaries and the '(' and ')' operators have been marked obsolescent."
suggesting "&&" being preferred over "-a".
> Chris >