Index: /tags/ipp-ops-20220906/Ohana/src/opihi/lib.shell/opihi.c
===================================================================
--- /tags/ipp-ops-20220906/Ohana/src/opihi/lib.shell/opihi.c	(revision 42949)
+++ /tags/ipp-ops-20220906/Ohana/src/opihi/lib.shell/opihi.c	(revision 42950)
@@ -4,5 +4,4 @@
 int opihi (int argc, char **argv) {
 
-  int Nbad;
   char *line, *prompt, *history;
   pid_t ppid;
@@ -15,5 +14,9 @@
   welcome ();
 
-  Nbad = 0;
+  // if HISTORY is defined, and does not have the value NONE, save history
+  int SaveHistory = TRUE;
+  if (!history || !strcasecmp(history, "none")) { SaveHistory = FALSE; }
+
+  int Nbad = 0;
   while (1) {  /** must exit with command "exit" or "quit" */
     if (Nbad == 10) exit (20);
@@ -40,9 +43,9 @@
     if (*line) {
       multicommand (line);
-      add_history (line);
+      if (SaveHistory) { add_history (line); }
 
 // the libedit version of readline does not support an incremental write to history file
 # ifdef RL_READLINE_VERSION
-      if (history != NULL) append_history (1, history);
+      if (SaveHistory) { append_history (1, history); }
 # endif
 
Index: /tags/ipp-ops-20220906/Ohana/src/opihi/pclient/pclient.c.in
===================================================================
--- /tags/ipp-ops-20220906/Ohana/src/opihi/pclient/pclient.c.in	(revision 42949)
+++ /tags/ipp-ops-20220906/Ohana/src/opihi/pclient/pclient.c.in	(revision 42950)
@@ -4,5 +4,5 @@
 # define opihi_prompt "pclient: "
 # define opihi_description "pcontrol client shell\n"
-# define opihi_history ""
+# define opihi_history "NONE"
 # define opihi_rcfile ".pcontrolrc"
 
@@ -76,5 +76,9 @@
   FreeBasic ();
   FreePclient ();
-  gprint (GP_LOG, "Goodbye\n");
+  gprint (GP_LOG, "Goodbye\n"); // sent to pcontrol to signal exit
+
+  free_error (); // init_error() called in lib.shell/startup.c general_init()
+  gprintFree (); // gprintInit() called in lib.shell/startup.c general_init()
+
   return;
 }
@@ -106,4 +110,5 @@
   int status;
   status = opihi (argc, argv);
+
   exit (status);
 }
Index: /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/JobOps.c	(revision 42949)
+++ /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/JobOps.c	(revision 42950)
@@ -270,4 +270,5 @@
 
   FREE (job[0].hostname);
+  FREE (job[0].realhost);
   for (i = 0; i < job[0].argc; i++) {
     FREE (job[0].argv[i]);
Index: /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/pcontrol.c.in
===================================================================
--- /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 42949)
+++ /tags/ipp-ops-20220906/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 42950)
@@ -6,6 +6,10 @@
 # define opihi_prompt "pcontrol: "
 # define opihi_description "pcontrol client shell\n"
-# define opihi_history ".pcontrol"
+# define opihi_history "NONE"
 # define opihi_rcfile ".pcontrolrc"
+
+# ifdef THREADED  
+  static pthread_t clientsThread;
+# endif
 
 /* program-dependent initialization */
@@ -14,8 +18,4 @@
   OHANA_UNUSED_PARAM(argv);
   
-# ifdef THREADED  
-  pthread_t clientsThread;
-# endif
-
   auto_break = TRUE;
 
@@ -83,8 +83,14 @@
   SetRunLevel (PCONTROL_RUN_HOSTS); 
   DownHosts ();
+
+  QuitCheckSystemThread();
+  pthread_join (clientsThread, NULL);
+
   ConfigFree ();
-
   FreeBasic ();
   FreePcontrol ();
+
+  free_error (); // init_error() called in lib.shell/startup.c general_init()
+  gprintFree (); // gprintInit() called in lib.shell/startup.c general_init()
 
   return;
