ash: expr -e support

This commit is contained in:
David van Moolenbroek
2010-06-16 09:33:11 +00:00
parent 482afb8a6f
commit 0964b221e7
3 changed files with 6 additions and 0 deletions

View File

@@ -279,6 +279,9 @@ expr_operator(op, sp, fs)
sp->u.num = expr_is_false(sp);
sp->type = BOOLEAN;
break;
case EXISTS:
if (fs->rcode >= 0) goto true;
goto false;
case ISREAD:
i = 04;
goto permission;

View File

@@ -5,6 +5,7 @@
# by the Ash General Public License. See the file named LICENSE.
NOT ! 3
EXISTS -e 12 OP_FILE
ISREAD -r 12 OP_FILE
ISWRITE -w 12 OP_FILE
ISEXEC -x 12 OP_FILE