On 08/23/2017 10:17 AM, Chet Ramey wrote: > On 8/23/17 11:13 AM, dethrophes wrote: >> Yhea I just learned that now, it's been at least a decade since I looked at >> the posix spec on test. >> >> Should probably update the bash help to reflect that >> >> as help bash (in my version at least) only says >> >> EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. >> EXPR1 -o EXPR2 True if either expr1 OR expr2 is true. > > Why update the help documentation? Bash supports it. It's just deprecated > in the posix standard.
Not just deprecated, but inherently ambiguous. There are situations where you CANNOT tell whether the user meant -a to mean the binary operator or a string being tested against, because POSIX (intentionally) does not specify enough precedence rules in how to parse > 4 arguments. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature