Index: /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/expand_vars.c
===================================================================
--- /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/expand_vars.c	(revision 30299)
+++ /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/expand_vars.c	(revision 30300)
@@ -64,5 +64,14 @@
     /* variable assignment (skip these variables) */
     if ((L == line) && (V1 != NULL)) {
-      if ((*V1 == '=') || !strcmp (V1, "++") || !strcmp (V1, "--")) {
+      int isAssignment;
+
+      isAssignment = FALSE;
+      isAssignment |= (V1[0] == '=');
+      isAssignment |= (V1[0] == '+') && (V1[1] == '=');
+      isAssignment |= (V1[0] == '-') && (V1[1] == '=');
+      isAssignment |= (V1[0] == '+') && (V1[1] == '+');
+      isAssignment |= (V1[0] == '-') && (V1[1] == '-');
+
+      if (isAssignment) {
 	*N = *L;
 	free (V0);
Index: /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/parse.c
===================================================================
--- /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/parse.c	(revision 30299)
+++ /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/parse.c	(revision 30300)
@@ -51,4 +51,48 @@
     }
 
+    if (!strncmp (V1, "+=", 2)) {
+	V1 ++;
+	if (*V1 == 0) goto error;
+	V1 ++;
+	if (*V1 == 0) goto error;
+
+	val = get_variable (V0);
+	if (val == NULL) {
+	    fval = 0.0;
+	} else {
+	    fval = atof (val);
+	}
+
+	/* dvomath returns a new string, or NULL, with the result of the expression */
+	val = dvomath (1, &V1, &size, 0);
+	if (val == NULL) goto error;
+	fval += atof(val);
+	// save the result
+	set_variable (V0, fval);
+	goto escape;
+    }
+
+    if (!strncmp (V1, "-=", 2)) {
+	V1 ++;
+	if (*V1 == 0) goto error;
+	V1 ++;
+	if (*V1 == 0) goto error;
+
+	val = get_variable (V0);
+	if (val == NULL) {
+	    fval = 0.0;
+	} else {
+	    fval = atof (val);
+	}
+
+	/* dvomath returns a new string, or NULL, with the result of the expression */
+	val = dvomath (1, &V1, &size, 0);
+	if (val == NULL) goto error;
+	fval -= atof(val);
+	// save the result
+	set_variable (V0, fval);
+	goto escape;
+    }
+
     /* not an assignement, syntax error */
     if (*V1 != '=') goto error;
@@ -90,5 +134,8 @@
 	}
       }
-    } 
+      // save the resulting value
+      set_str_variable (V0, val);
+      goto escape;  /* frees temp variables */
+    }
 
     /* simple variable assignment */
@@ -99,5 +146,5 @@
       val = strcreate (V1);
     } 
-    /* both dvomath and command replacement create (char *) val */
+    // save the result
     set_str_variable (V0, val);
     goto escape;  /* frees temp variables */
Index: /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/stack_math.c	(revision 30299)
+++ /branches/eam_branches/ipp-20101205/Ohana/src/opihi/lib.shell/stack_math.c	(revision 30300)
@@ -972,6 +972,5 @@
 	*out = OP;						\
       }								\
-      clear_stack (V1);						\
-      return (TRUE);						\
+      goto escape;						\
     }								\
     if ((V1->vector->type == OPIHI_INT) && (FTYPE == 'S')) {	\
@@ -982,6 +981,5 @@
 	*out = OP;						\
       }								\
-      clear_stack (V1);						\
-      return (TRUE);						\
+      goto escape;						\
     }								\
     if ((V1->vector->type == OPIHI_INT) && (FTYPE == 's')) {	\
@@ -992,6 +990,5 @@
 	*out = OP;						\
       }								\
-      clear_stack (V1);						\
-      return (TRUE);						\
+      goto escape;						\
     } }							
 
@@ -1035,4 +1032,6 @@
 # undef V_FUNC
 
+escape:
+
   if (V1[0].type == 'v') {
     free (V1[0].vector[0].elements.Ptr);
