diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 15 | ||||
-rw-r--r-- | shell/hush.c | 12 |
2 files changed, 26 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 45c747d..713219b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -197,7 +197,20 @@ #define IF_BASH_PATTERN_SUBST IF_ASH_BASH_COMPAT #define BASH_SUBSTR ENABLE_ASH_BASH_COMPAT #define IF_BASH_SUBSTR IF_ASH_BASH_COMPAT -/* [[ EXPR ]] */ +/* BASH_TEST2: [[ EXPR ]] + * Status of [[ support: + * We replace && and || with -a and -o + * TODO: + * singleword+noglob expansion: + * v='a b'; [[ $v = 'a b' ]]; echo 0:$? + * [[ /bin/* ]]; echo 0:$? + * -a/-o are not AND/OR ops! (they are just strings) + * quoting needs to be considered (-f is an operator, "-f" and ""-f are not; etc) + * = is glob match operator, not equality operator: STR = GLOB + * (in GLOB, quoting is significant on char-by-char basis: a*cd"*") + * == same as = + * add =~ regex match operator: STR =~ REGEX + */ #define BASH_TEST2 (ENABLE_ASH_BASH_COMPAT * ENABLE_ASH_TEST) #define BASH_SOURCE ENABLE_ASH_BASH_COMPAT #define BASH_PIPEFAIL ENABLE_ASH_BASH_COMPAT diff --git a/shell/hush.c b/shell/hush.c index 98ba96e..3afb70c 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -79,6 +79,18 @@ * Some builtins mandated by standards: * newgrp [GRP]: not a builtin in bash but a suid binary * which spawns a new shell with new group ID + * + * Status of [[ support: + * [[ args ]] are CMD_SINGLEWORD_NOGLOB: + * v='a b'; [[ $v = 'a b' ]]; echo 0:$? + * [[ /bin/* ]]; echo 0:$? + * TODO: + * &&/|| are AND/OR ops, -a/-o are not + * quoting needs to be considered (-f is an operator, "-f" and ""-f are not; etc) + * = is glob match operator, not equality operator: STR = GLOB + * (in GLOB, quoting is significant on char-by-char basis: a*cd"*") + * == same as = + * add =~ regex match operator: STR =~ REGEX */ //config:config HUSH //config: bool "hush (64 kb)" |