Index: /trunk/Ohana/src/opihi/cmd.astro/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 4745)
+++ /trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 4746)
@@ -119,2 +119,5 @@
 	rm -f $(BIN)/*
 	rm -f $(LIB)/*
+
+uninstall:
+	rm -f $(DESTLIB)/libcmdastro.a
Index: /trunk/Ohana/src/opihi/cmd.basic/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 4745)
+++ /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 4746)
@@ -47,4 +47,5 @@
 $(SDIR)/shell.$(ARCH).o	     \
 $(SDIR)/sprintf.$(ARCH).o    \
+$(SDIR)/fprintf.$(ARCH).o    \
 $(SDIR)/strlen.$(ARCH).o     \
 $(SDIR)/substr.$(ARCH).o     \
@@ -109,2 +110,5 @@
 	rm -f $(BIN)/*
 	rm -f $(LIB)/*
+
+uninstall:
+	rm -f $(DESTLIB)/libcmdbasic.a
Index: /trunk/Ohana/src/opihi/cmd.basic/fprintf.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/fprintf.c	(revision 4746)
+++ /trunk/Ohana/src/opihi/cmd.basic/fprintf.c	(revision 4746)
@@ -0,0 +1,80 @@
+# include "basic.h"
+# define NCHAR 1024
+
+int fprintf_opihi (int argc, char **argv) {
+
+  int i;
+  char line[NCHAR], tmp[NCHAR], fmt[NCHAR];
+  char *p1, *p2, *q;
+
+  if (argc < 2) {
+    fprintf (stderr, "USAGE: fprintf format value value ...\n");
+    return (FALSE);
+  }
+
+  q  = line;
+  bzero (line, NCHAR);
+
+  p1 = argv[1];
+  for (i = 2; i < argc; i++) {
+    bzero (tmp, NCHAR);
+    bzero (fmt, NCHAR);
+
+    /* find next format character */
+    p2 = strchr (p1, '%');
+    if (p2 == (char *) NULL) {
+      fprintf (stderr, "mismatch between format and values\n");
+      return (FALSE);
+    }
+    if (strlen(q) + p2 - p1 > NCHAR) {
+      fprintf (stderr, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, p1, p2-p1);
+    q = line + strlen(line);
+    
+    /* identify type (%NNNs %NNNNd %NNNNf) */
+    for (p1 = p2 + 1; (*p1 == '.') || (*p1 == '-') || (*p1 == '+') || (*p1 == ' ') || isdigit(*p1); p1++);
+    memcpy (fmt, p2, p1 - p2 + 1);
+    switch (*p1) {
+      case 'e':
+      case 'f':
+	sprintf (tmp, fmt, atof(argv[i]));
+	break;
+      case 's':
+	sprintf (tmp, fmt, argv[i]);
+	break;
+      case 'd':
+      case 'c':
+      case 'x':
+	sprintf (tmp, fmt, atoi(argv[i]));
+	break;
+      default:
+	fprintf (stderr, "syntax error in format (only e,f,s,d,c,x allowed)\n");
+	return (FALSE);
+    }
+    if (strlen(q) + strlen(tmp) > NCHAR) {
+      fprintf (stderr, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, tmp, strlen(tmp));
+    q = line + strlen(line);
+    p1++;
+  }
+  p2 = strchr (p1, '%');
+  if (p2 != (char *) NULL) {
+    fprintf (stderr, "mismatch between format and values\n");
+    return (FALSE);
+  }
+  
+  p2 = p1 + strlen (p1);
+  if (strlen(q) + p2 - p1 > NCHAR) {
+    fprintf (stderr, "line too long");
+    return (FALSE);
+  }
+  memcpy (q, p1, p2-p1);
+  fprintf (GetOutfile(), "%s\n", line);
+
+  return (TRUE);
+}
+
Index: /trunk/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4745)
+++ /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4746)
@@ -28,4 +28,5 @@
 int shell      	    PROTO((int, char **));
 int sprintf_opihi   PROTO((int, char **));
+int fprintf_opihi   PROTO((int, char **));
 int strlen_func     PROTO((int, char **));
 int substr_func     PROTO((int, char **));
@@ -65,4 +66,5 @@
   {"exec",    	    shell,              "system call"},
   {"sprintf",       sprintf_opihi,      "formatted print to a variable"},
+  {"fprintf",       fprintf_opihi,      "formatted print to standard output"},
   {"strlen",        strlen_func,        "string length"},
   {"substr",        substr_func,        "substring"},
Index: /trunk/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 4745)
+++ /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 4746)
@@ -178,2 +178,5 @@
 	rm -f $(BIN)/*
 	rm -f $(LIB)/*
+
+uninstall:
+	rm -f $(DESTLIB)/libcmddata.a
Index: /trunk/Ohana/src/opihi/lib.data/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/Makefile	(revision 4745)
+++ /trunk/Ohana/src/opihi/lib.data/Makefile	(revision 4746)
@@ -40,9 +40,11 @@
 $(SDIR)/PlotVectors.$(ARCH).o
 
-libdata:    $(DESTLIB)/libdata.a 
+libdata: $(DESTLIB)/libdata.a
 
-$(LIB)/libdata.$(ARCH).a:   	$(libdata)
+$(LIB)/libdata.$(ARCH).a: $(libdata)
 
 # utilities #################################################
+# .SUFFIXES: .$(ARCH).o
+
 $(BIN)/%.$(ARCH):
 	@if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi
@@ -94,2 +96,5 @@
 	rm -f $(BIN)/*
 	rm -f $(LIB)/*
+
+uninstall:
+	rm -f $(DESTLIB)/libdata.a
Index: /trunk/Ohana/src/opihi/lib.shell/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/Makefile	(revision 4745)
+++ /trunk/Ohana/src/opihi/lib.shell/Makefile	(revision 4746)
@@ -117,2 +117,5 @@
 	rm -f $(BIN)/*
 	rm -f $(LIB)/*
+
+uninstall:
+	rm -f $(DESTLIB)/libshell.a
