> > POSIX specifies that it *should* be inconsistent, i.e. the cases with 0, > 1, 2, 3, and 4 args are different than the cases with 5 or more args. As > always, this appears to be a historical compromise to reconcile the > behavior of different shells in common cases. > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > (scroll down) > Thanks, that explains it!
I edited a version I was using to address some issues mentioned in this thread. https://github.com/spiterikevin/toybox/blob/compoundtest/toys/pending/test.c There are still some differences from coreutils. E.g., in coreutils, [ \( \( \) \) \) ] is true because the inner \) is treated as a plain string. [ \( \( \( \) \) ] is a syntax error. Removing one set of outer parentheses gets into the explicit 3-argument special cases and both become true. How important is it to match these details to coreutils? In my implementation the 3-argument cases match, but both 5-argument cases are syntax errors. Kevin
_______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
