[gnu.bash.bug] Does anyone have bash working on System V?

6sigma@polari.UUCP (Brian Matthews) (09/18/89)

I recently picked up bash 1.03, and am trying to get it to run on a
fairly standard System V Release 2 box, but not having much luck.

The problems seem mostly to do with nojobs.c.  For instance, it uses
sigignore and sigrelse, which aren't available in SVR2, and nojobs.c
doesn't contain wait_for_{single,background}_pid functions, even
though jobs.c does and builtins.c calls them.

So, has anyone had any luck getting bash running on SVR2?  If so, could
you give me some pointers?

If no one's done this, I'll probably try to get it working (but it won't
be soon, being I have to do it in my copious free time :-).

Thanx much,
Brian L. Matthews
blm@6sigma.UUCP

tim@banyan.UUCP (Tim Henrion@Eng@Banyan) (09/21/89)

I've got bash 1.03 to work, for the most part, on our SYSV.3.2
implementation. There are a few problems (a lot of them non-SYSV
dependent).

	1) A lot of the source files that have conditional (#ifdef)
	   code DON'T INCLUDE "config.h" (like parse.y)! You have to
	   fix this for files that need it
	2) You'll have to hack nojobs.c. You can take
	   wait_for_single_pid() from jobs.c but wait_for_background_pids()
	   uses job control stuff and can't be used. You'll have to
	   #ifdef JOB_CONTROL the calls to it out of builtins.c.

The only remaining problem I have is that it barfs sometimes trying
to execute shell scripts. I think the error message is:
	bash: can't execute binary file
or something like that. I'll see if I can find that one soon.

Tim Henrion
Banyan Systems Inc.
tim@banyan.com --or-- ...!buita!banyan!tim

bfox@AUREL.CALTECH.EDU (Brian Fox) (09/22/89)

   Date: 20 Sep 89 18:04:45 GMT
   From: spdcc!merk!xylogics!cloud9!banyan!tim@bu-cs.bu.edu  (Tim Henrion@Eng@Banyan)
   References: <1055@polari.UUCP>
   Sender: bug-bash-request@prep.ai.mit.edu

   I've got bash 1.03 to work, for the most part, on our SYSV.3.2
   implementation. There are a few problems (a lot of them non-SYSV
   dependent).

	   1) A lot of the source files that have conditional (#ifdef)
	      code DON'T INCLUDE "config.h" (like parse.y)! You have to
	      fix this for files that need it

Huh?  Parse.y includes shell.h, which includes config.h.

   The only remaining problem I have is that it barfs sometimes trying
   to execute shell scripts. I think the error message is:
	   bash: can't execute binary file
   or something like that. I'll see if I can find that one soon.

It could be that the scripts have a TAB within the first line.  I
examine the script to see if it is executable or not, but I had
forgotten this case.

execute_cmd.c: execute_simple_command ()


		      /* This file is executable.
			 Check to see if it is a binary file by seeing
			 if the first line (or upto 30 characters) are
			 in the ASCII set.
			 Execute the contents as shell commands. */
		      extern char *shell_name;
		      int larry = array_len (args) + 1;
		      int i;

		      {
			int fd = open (command, O_RDONLY);
			if (fd != -1)
			  {
			    unsigned char sample[30];
			    int sample_len = read (fd, &sample[0], 29);

			    if (sample_len != -1)
			      {
				for (i = 0; i < sample_len; i++)
				  {
				    if (sample[i] == '\n')
				      break;
				    if (sample[i] > 128 || sample[i] < ' ')
				      {
					if (sample[i] == '\t')
					  continue;

					report_error ("%s: Cannot execute binary file", shell_name);
					exit (EXECUTION_FAILURE);
				      }
				  }
			      }
			    close (fd);
			  }
		      }
Brian Fox