After looking at the sbase TODO I threw together test(1). As far as I
can tell it's POSIX compliant. I used the POSIX description[0] to
write it. It exits 0 for true, 1 for false, and 2 for bad input. Let
me know what's good and what's bad. I'll work on addresing those
concerns and getting it into sbase format so I can submit a patch.
It specifically doesn't support parentheses and the -o and -a flags as
1) they are obsolete xsi extensions[1]
2) boolean operators are and should be handled by the shell. e.g. [
foo = bar ] || [ 4 -lt 5 ]
-emg
[0]
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
[1]
http://pubs.opengroup.org/onlinepubs/9699919799/help/codes.html#OB XSI
- text/x-csrc attachment: test.c
Received on Wed Oct 15 2014 - 22:24:26 CEST