summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-10 12:09:48 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2009-06-10 12:09:48 (GMT)
commit77539190ab9ca49518cf7e7a7b052c913ca7709d (patch)
tree99e4067fcd326185966f63e7054f561826a4fcfb
parent9ca656b14945ec8462dc529ef5dc7662cce08296 (diff)
downloadbusybox-77539190ab9ca49518cf7e7a7b052c913ca7709d.tar.gz
busybox-77539190ab9ca49518cf7e7a7b052c913ca7709d.tar.bz2
added comments about [[ ]] to ash and hush. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c5
-rw-r--r--shell/hush.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 7843afa..c726ad4 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8736,6 +8736,11 @@ static int ulimitcmd(int, char **) FAST_FUNC;
* Additional operators:
* || and && should work as -o and -a
* =~ regexp match
+ * == should do _pattern match_ against right side. bash does this:
+ * # [[ *a* == bab ]] && echo YES
+ * # [[ bab == *a* ]] && echo YES
+ * YES
+ * != does the negated == (i.e., also with pattern matching)
* Apart from the above, [[ expr ]] should work as [ expr ]
*/
diff --git a/shell/hush.c b/shell/hush.c
index 54ab78b..245fb58 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -318,6 +318,11 @@ struct command {
// Additional operators:
// || and && should work as -o and -a
// =~ regexp match
+// == should do _pattern match_ against right side. bash does this:
+// # [[ *a* == bab ]] && echo YES
+// # [[ bab == *a* ]] && echo YES
+// YES
+// != does the negated == (i.e., also with pattern matching)
// Apart from the above, [[ expr ]] should work as [ expr ]
/* used for "export noglob=* glob* a=`echo a b`" */