summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-04-10 15:25:41 +0200
committerDenys Vlasenko2018-04-10 15:25:41 +0200
commit3632cb15f16a7596a68dccfd66a2ad9496bf9fd9 (patch)
treeb1725852f1437a684c87e082ca20190819d2ddc6 /shell/ash.c
parent4709df0f152c477c191f83e18bfecabb2fb2c1f9 (diff)
downloadbusybox-3632cb15f16a7596a68dccfd66a2ad9496bf9fd9.zip
busybox-3632cb15f16a7596a68dccfd66a2ad9496bf9fd9.tar.gz
shell: add comments about [[, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c15
1 files changed, 14 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