From: Qi Xia (qx@shire.math.columbia.edu)
Date: 11/27/92


From: qx@shire.math.columbia.edu (Qi Xia)
Subject: Re: bash+98.5 (need patch or binary!)
Date: Sat, 28 Nov 1992 00:56:16 GMT


In <1992Nov26.150349.1406@odin.diku.dk>, Niels Olsen wrote:
    As is obvious to many, bash's version of echo when used in scripts dumps
    core under 98.5. This means that makefiles and configuring scripts won't
    work. It's hell to substitute echo with /usr/bin/echo throughut a directory
    tree of a project.

    So, could anyone point me to patches against virgin bash1.12 sources, or a
    binary of that will work under 98.5?

Here is my quick and dirty patch against bash-1.12 (1.12.2)
from prep.ai.mit.edu. It works for me under 0.98.5.

To install bash, I would suggest that you copy bash to /bin as bash1.
Then, set a user, say john, login shell to /bin/bash1. Login as john and
test bash1. If it works fine, set root login shell to bash1, login as root,
copy bash1 to bash. Then, set login shell back to bash or so.

====================[ patch for bash=1.12 ]============================

diff -cr bash-org/Makefile bash-1.12/Makefile
*** bash-org/Makefile Sat Jan 18 14:43:12 1992
--- bash-1.12/Makefile Fri Nov 20 21:56:52 1992
***************
*** 10,16 ****
  #
  # If you haven't read README, now might be a good time.
  
! DESTDIR = /usr/gnu/bin
  MAKE = make
  RM = rm -f
  SHELL = /bin/sh
--- 10,17 ----
  #
  # If you haven't read README, now might be a good time.
  
! CC = gcc -O6 -fomit-frame-pointer
! DESTDIR = /bin
  MAKE = make
  RM = rm -f
  SHELL = /bin/sh
diff -cr bash-org/braces.c bash-1.12/braces.c
*** bash-org/braces.c Sun Jul 7 14:36:14 1991
--- bash-1.12/braces.c Fri Nov 20 21:17:04 1992
***************
*** 110,116 ****
  #if defined (SHELL)
    /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
       without doing any expansion. */
! if (index (amble, brace_arg_separator) == NULL)
      {
        free (amble);
        free (preamble);
--- 110,116 ----
  #if defined (SHELL)
    /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
       without doing any expansion. */
! if ( ! index (amble, brace_arg_separator) )
      {
        free (amble);
        free (preamble);
diff -cr bash-org/builtins/psize.c bash-1.12/builtins/psize.c
*** bash-org/builtins/psize.c Wed Oct 30 13:30:00 1991
--- bash-1.12/builtins/psize.c Fri Nov 20 21:29:40 1992
***************
*** 40,46 ****
    exit (0);
  }
  
! #if !defined (NeXT)
  char *
  memset (s, c, n)
       register char *s;
--- 40,46 ----
    exit (0);
  }
  
! #if 0 && !defined (NeXT)
  char *
  memset (s, c, n)
       register char *s;
diff -cr bash-org/cpp-Makefile bash-1.12/cpp-Makefile
*** bash-org/cpp-Makefile Sat Jan 25 21:16:31 1992
--- bash-1.12/cpp-Makefile Fri Nov 20 22:34:54 1992
***************
*** 192,198 ****
  SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
         $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) $(STRERROR) \
         -D$(MACHINE) -D$(OS)
! DEBUG_FLAGS = $(PROFILE_FLAGS) -g
  LDFLAGS = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(DEBUG_FLAGS)
  CFLAGS = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS)
  CPPFLAGS= -I$(LIBSRC)
--- 192,198 ----
  SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
         $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) $(STRERROR) \
         -D$(MACHINE) -D$(OS)
! DEBUG_FLAGS = $(PROFILE_FLAGS) # -g
  LDFLAGS = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(DEBUG_FLAGS)
  CFLAGS = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS)
  CPPFLAGS= -I$(LIBSRC)
***************
*** 476,486 ****
  
  #if defined (REQUIRED_LIBRARIES)
  /**/# Locally required libraries.
! LOCAL_LIBS = REQUIRED_LIBRARIES
  #endif /* REQUIRED_LIBRARIES */
  
  /**/# The order is important. Most dependent first.
! LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(GLOB_LIB) $(LOCAL_LIBS)
  
  #if defined (HAVE_TERMCAP_SOURCE)
  TERMCAP_DEP = TERMCAP_LIBRARY
--- 476,486 ----
  
  #if defined (REQUIRED_LIBRARIES)
  /**/# Locally required libraries.
! LOCAL_LIBS = # REQUIRED_LIBRARIES
  #endif /* REQUIRED_LIBRARIES */
  
  /**/# The order is important. Most dependent first.
! LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(GLOB_LIB) # $(LOCAL_LIBS)
  
  #if defined (HAVE_TERMCAP_SOURCE)
  TERMCAP_DEP = TERMCAP_LIBRARY
diff -cr bash-org/execute_cmd.c bash-1.12/execute_cmd.c
*** bash-org/execute_cmd.c Tue Jan 21 00:38:35 1992
--- bash-1.12/execute_cmd.c Fri Nov 20 21:08:20 1992
***************
*** 57,63 ****
--- 57,65 ----
  extern int set_job_control ();
  #endif /* JOB_CONTROL */
  
+ #if 0
  extern int getdtablesize ();
+ #endif
  extern int close ();
  extern char *strerror ();
  extern char *string_list ();
diff -cr bash-org/general.c bash-1.12/general.c
*** bash-org/general.c Mon Jan 20 23:35:27 1992
--- bash-1.12/general.c Fri Nov 20 21:06:36 1992
***************
*** 45,51 ****
  extern int errno;
  
  /* Make the functions index and rindex if they do not exist. */
! #if defined (USG) && !defined (sgi) && !defined (DGUX) && !defined (index)
  char *
  index (s, c)
       char *s;
--- 45,51 ----
  extern int errno;
  
  /* Make the functions index and rindex if they do not exist. */
! #if 0 && defined (USG) && !defined (sgi) && !defined (DGUX) && !defined (index)
  char *
  index (s, c)
       char *s;
***************
*** 54,60 ****
  }
  #endif /* USG && !sgi && !DGUX && !index */
  
! #if defined (USG) && !defined (sgi) && !DGUX && !defined (rindex)
  char *
  rindex (s, c)
       char *s;
--- 54,60 ----
  }
  #endif /* USG && !sgi && !DGUX && !index */
  
! #if 0 && defined (USG) && !defined (sgi) && !DGUX && !defined (rindex)
  char *
  rindex (s, c)
       char *s;
***************
*** 594,604 ****
       int e;
  {
    extern int sys_nerr;
    extern char *sys_errlist[];
    static char emsg[40];
  
    if (e > 0 && e < sys_nerr)
! return (sys_errlist[e]);
    else
      {
        sprintf (emsg, "Unknown error %d", e);
--- 594,606 ----
       int e;
  {
    extern int sys_nerr;
+ #if 0
    extern char *sys_errlist[];
+ #endif
    static char emsg[40];
  
    if (e > 0 && e < sys_nerr)
! return ((char *) sys_errlist[e]);
    else
      {
        sprintf (emsg, "Unknown error %d", e);
***************
*** 720,726 ****
   *
   */
  
! #if defined (USG) || defined (HPUX)
  int
  getdtablesize ()
  {
--- 722,728 ----
   *
   */
  
! #if 0 && defined (USG) || defined (HPUX)
  int
  getdtablesize ()
  {
***************
*** 742,748 ****
  
  #if defined (USG) && !defined (sgi)
  
! #if !defined (RISC6000)
  bcopy(s,d,n) char *d,*s; { memcpy (d, s, n); }
  bzero(s,n) char *s; int n; { memset(s, '\0', n); }
  #endif /* RISC6000 */
--- 744,750 ----
  
  #if defined (USG) && !defined (sgi)
  
! #if 0 && !defined (RISC6000)
  bcopy(s,d,n) char *d,*s; { memcpy (d, s, n); }
  bzero(s,n) char *s; int n; { memset(s, '\0', n); }
  #endif /* RISC6000 */
diff -cr bash-org/jobs.c bash-1.12/jobs.c
*** bash-org/jobs.c Fri Jan 17 16:36:11 1992
--- bash-1.12/jobs.c Fri Nov 20 21:13:53 1992
***************
*** 104,110 ****
--- 104,112 ----
  extern int errno;
  extern int interactive, asynchronous_notification;
  extern char *shell_name;
+ #if 0
  extern char *sys_siglist[];
+ #endif
  
  /* The array of known jobs. */
  JOB **jobs = (JOB **)NULL;
***************
*** 712,720 ****
          else
            {
                if (WIFSTOPPED (show->status))
! temp = sys_siglist[WSTOPSIG (show->status)];
                else if (WIFSIGNALED (show->status))
! temp = sys_siglist[WTERMSIG (show->status)];
                else if (WIFEXITED (show->status))
                  {
                    temp = retcode_name_buffer;
--- 714,722 ----
          else
            {
                if (WIFSTOPPED (show->status))
! temp = (char *) sys_siglist[WSTOPSIG (show->status)];
                else if (WIFSIGNALED (show->status))
! temp = (char *) sys_siglist[WTERMSIG (show->status)];
                else if (WIFEXITED (show->status))
                  {
                    temp = retcode_name_buffer;
diff -cr bash-org/lib/readline/readline.c bash-1.12/lib/readline/readline.c
*** bash-org/lib/readline/readline.c Sat Jan 25 16:47:30 1992
--- bash-1.12/lib/readline/readline.c Fri Nov 20 21:33:22 1992
***************
*** 150,156 ****
  # endif /* USG */
  #endif /* !POSIX_VERSION && !USGr3 */
  
! #if defined (USG) && defined (TIOCGWINSZ)
  # include <sys/stream.h>
  # if defined (USGr4) || defined (USGr3)
  # if defined (Symmetry) || defined (_SEQUENT_)
--- 150,156 ----
  # endif /* USG */
  #endif /* !POSIX_VERSION && !USGr3 */
  
! #if 0 && defined (USG) && defined (TIOCGWINSZ)
  # include <sys/stream.h>
  # if defined (USGr4) || defined (USGr3)
  # if defined (Symmetry) || defined (_SEQUENT_)
diff -cr bash-org/shell.c bash-1.12/shell.c
*** bash-org/shell.c Tue Jan 21 00:52:37 1992
--- bash-1.12/shell.c Fri Nov 20 21:51:24 1992
***************
*** 1193,1199 ****
  {
    initialize_terminating_signals ();
    initialize_job_signals ();
! #if defined (INITIALIZE_SIGLIST)
    initialize_siglist ();
  #endif
  }
--- 1193,1199 ----
  {
    initialize_terminating_signals ();
    initialize_job_signals ();
! #if 0 && defined (INITIALIZE_SIGLIST)
    initialize_siglist ();
  #endif
  }
diff -cr bash-org/siglist.c bash-1.12/siglist.c
*** bash-org/siglist.c Wed Oct 30 13:27:59 1991
--- bash-1.12/siglist.c Fri Nov 20 21:27:03 1992
***************
*** 30,39 ****
--- 30,42 ----
  # endif /* !_NSIG */
  #endif /* !NSIG */
  
+ #if 0
  char *sys_siglist[NSIG];
+ #endif
  
  extern char *xmalloc (), *malloc ();
  
+ #if 0
  initialize_siglist ()
  {
    register int i;
***************
*** 218,220 ****
--- 221,224 ----
        }
      }
  }
+ #endif