Subject: Re: new dt.tar.gz
To: None <psiebold@cymbal.aix.calpoly.edu>
From: Lawrence Kesteloot <lk@milquetoast.engr.sgi.com>
List: macbsd-general
Date: 07/19/1994 09:37:30
   Date: Mon, 18 Jul 1994 21:57:59 -0700 (PDT)
   From: Peter Siebold <psiebold@cymbal.aix.calpoly.edu>

   Quick general question.  dt with the new kernel requires bash right?  If 
   it does, where is the port to NetBSD?  Bash 1.14 does not compile.  Is 
   there a way to make the dt uses csh instead of bash.

This patch allows you to use your login shell (usually.  To be
precise, the shell program specified in the environment SHELL).  If it
cannot find env. SHELL, it tries to use bash (should it be sh or
csh?).

Recompiling dt is much faster than compiling bash 8-).

Hope you like it.

Ken

*** main.c~	Wed Jul  6 04:44:34 1994
--- main.c	Tue Jul 19 10:40:35 1994
***************
*** 80,85 ****
--- 80,86 ----
  {
  	int	f;
  	char	devstr[128];
+ 	char    *sh, *shname;
  
  	sprintf (devstr, "/dev/ttyp%x", ttynum);
  
***************
*** 117,125 ****
  	}
  	printf ("Virtual console number %d\n\n", vtnum + 1);
  
! 	execl ("/usr/local/bin/bash", "bash", "-login", NULL);
  
! 	perror ("bash");
  
  	return;
  }
--- 118,134 ----
  	}
  	printf ("Virtual console number %d\n\n", vtnum + 1);
  
! 	if ((sh = getenv("SHELL")) == NULL) {
! 	  sh = "/usr/local/bin/bash";
! 	  shname = "bash";
! 	} else if ((shname = strrchr(sh, '/')) == NULL) {
! 	  shname = sh;
! 	} else {
! 	  shname++;
! 	}
! 	execl(sh, shname, NULL);
  
! 	perror(shname);
  
  	return;
  }

------------------------------------------------------------------------------