Mysterious error message: scenario please

mouse at mcgill-vision.UUCP mouse at mcgill-vision.UUCP
Mon Nov 24 13:39:46 AEST 1986


In article <1369 at umd5>, don at umd5 (Chris Sylvain) writes:
> I'd like to know just what could possibly be causing the following error
> message in response to a call to system() with a string that if typed
> by hand to a shell works just fine -- "00: is not an identifier".

As you have probably already been informed, this is because the Bourne
shell, which is the shell system() uses, doesn't like environment
entries not conforming to a specific syntax.

[This is a BUG, do you hear me, a BUG....]

Might I suggest a patch to sh (line numbers are 4.3BSD version, but
this should work on the 4.2 version if you adjust the line numbers):

	diff -c -r sh/name.c /usr/src/bin/sh/name.c
	*** sh/name.c	Sun Nov 23 22:28:13 1986
	--- /usr/src/bin/sh/name.c	Sun Nov 10 18:32:05 1985
	***************
	*** 55,61 ****
	  {
	  	WHILE arg
	  	DO REG STRING	s=mactrim(arg->argval);
	! 	   setname(s, xp, 0);
	  	   arg=arg->argnxt;
	  	   IF flags&execpr
	  	   THEN prs(s);
	--- 55,61 ----
	  {
	  	WHILE arg
	  	DO REG STRING	s=mactrim(arg->argval);
	! 	   setname(s, xp);
	  	   arg=arg->argnxt;
	  	   IF flags&execpr
	  	   THEN prs(s);
	***************
	*** 64,73 ****
	  	OD
	  }
	  
	! VOID	setname(argi, xp, nofail)
	  	STRING		argi;
	  	INT		xp;
	- int nofail;
	  {
	  	REG STRING	argscan=argi;
	  	REG NAMPTR	n;
	--- 64,72 ----
	  	OD
	  }
	  
	! VOID	setname(argi, xp)
	  	STRING		argi;
	  	INT		xp;
	  {
	  	REG STRING	argscan=argi;
	  	REG NAMPTR	n;
	***************
	*** 98,107 ****
	  			return;
	  		FI
	  	FI
	!  if (nofail)
	!   { return;
	!   }
	!  failed(argi,notid);
	  }
	  
	  replace(a, v)
	--- 97,103 ----
	  			return;
	  		FI
	  	FI
	! 	failed(argi,notid);
	  }
	  
	  replace(a, v)
	***************
	*** 306,312 ****
	  	REG STRING	*e=environ;
	  
	  	WHILE *e
	! 	DO setname(*e++, N_ENVNAM, 1) OD
	  }
	  
	  LOCAL INT	namec;
	--- 302,308 ----
	  	REG STRING	*e=environ;
	  
	  	WHILE *e
	! 	DO setname(*e++, N_ENVNAM) OD
	  }
	  
	  LOCAL INT	namec;

					der Mouse

USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse
     think!mosart!mcgill-vision!mouse
Europe: mcvax!decvax!utcsri!mcgill-vision!mouse
ARPAnet: think!mosart!mcgill-vision!mouse at harvard.harvard.edu

[USA NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode]



More information about the Comp.unix.questions mailing list