Index: /trunk/Ohana/src/opihi/cmd.basic/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 25964)
+++ /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 25965)
@@ -30,4 +30,5 @@
 $(SRC)/help.$(ARCH).o	     \
 $(SRC)/input.$(ARCH).o	     \
+$(SRC)/inthash.$(ARCH).o     \
 $(SRC)/list.$(ARCH).o	     \
 $(SRC)/list_help.$(ARCH).o  \
Index: /trunk/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 25964)
+++ /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 25965)
@@ -16,4 +16,5 @@
 int help            PROTO((int, char **));
 int input           PROTO((int, char **));
+int inthash         PROTO((int, char **));
 int list            PROTO((int, char **));
 int list_help       PROTO((int, char **));
@@ -61,4 +62,5 @@
   {1, "help",          help,               "get help on a function *"},
   {1, "input",         input,              "read command lines from a file *"},
+  {1, "inthash",       inthash,            "generate a hash for a word treated as an integer"},
   {1, "list",          list,               "get variable list"},
   {1, "?",             list_help,          "list commands *"},
Index: /trunk/Ohana/src/opihi/cmd.basic/inthash.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/inthash.c	(revision 25965)
+++ /trunk/Ohana/src/opihi/cmd.basic/inthash.c	(revision 25965)
@@ -0,0 +1,37 @@
+# include "basic.h"
+
+int inthash (int argc, char **argv) {
+
+  int i, N, modulus, value, input;
+  char *varName;
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: inthash (word) (modulus) [-var value]\n");
+    gprint (GP_ERR, "  treats the word as an integer when applying the modulus\n");
+    return (FALSE);
+  }
+
+  modulus = atoi(argv[2]);
+  if (modulus > 255) {
+    gprint (GP_ERR, "for the moment, (modulus) is limited to 255\n");
+    return (FALSE);
+  }
+
+  input = atoi(argv[1]);
+  value = input % modulus;
+  
+  if (varName) {
+    set_int_variable (varName, value);
+  } else {
+    gprint (GP_LOG, "%d\n", value);
+  }
+
+  return (TRUE);
+}
Index: /trunk/Ohana/src/opihi/cmd.basic/list.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 25964)
+++ /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 25965)
@@ -34,4 +34,43 @@
     sprintf (line, "%s:n", argv[1]);
     set_int_variable (line, i);
+
+    return (TRUE);
+  }
+
+  // return an error if -add is given with no other args
+  if ((argc > 2) && (!strcmp (argv[2], "-splitbychar"))) {
+    if (argc < 4) {
+      gprint (GP_ERR, "USAGE: list (root) -splitbychar (char) (word) [(word)...]\n");
+      return (FALSE);
+    }
+    
+    int j, nWords;
+    char splitter;
+    char *new, *word, *ptr;
+
+    nWords = 0;
+    splitter = argv[3][0];
+
+    for (i = 0; i < argc - 3; i++) {
+      new = strcreate (argv[i+3]);
+      for (j = 0; new[j]; j++) {
+	if (new[j] == splitter) new[j] = ' ';
+      }
+
+      ptr = new;
+      while (ptr) {
+	word = thisword (ptr);
+	if (!word) break;
+	
+	sprintf (line, "%s:%d", argv[1], nWords);
+	set_str_variable (line, word);
+	FREE (word);
+	ptr = nextword (ptr);
+	nWords ++;
+      }
+      FREE (new);
+    }
+    sprintf (line, "%s:n", argv[1]);
+    set_int_variable (line, nWords);
 
     return (TRUE);
Index: /trunk/Ohana/src/opihi/cmd.basic/strhash.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/strhash.c	(revision 25964)
+++ /trunk/Ohana/src/opihi/cmd.basic/strhash.c	(revision 25965)
@@ -14,5 +14,5 @@
 
   if (argc != 3) {
-    gprint (GP_ERR, "USAGE: strhash (string) (modulus)\n");
+    gprint (GP_ERR, "USAGE: strhash (string) (modulus) [-var value]\n");
     return (FALSE);
   }
Index: /trunk/Ohana/src/opihi/lib.shell/ListOps.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/ListOps.c	(revision 25964)
+++ /trunk/Ohana/src/opihi/lib.shell/ListOps.c	(revision 25965)
@@ -187,4 +187,5 @@
       if (!strcmp (temp, "-x")) goto escape;
       if (!strcmp (temp, "-split")) goto escape;
+      if (!strcmp (temp, "-splitbychar")) goto escape;
       if (!strcmp (temp, "-add")) goto escape;
       if (!strcmp (temp, "-del")) goto escape;
