Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Mysterious error message: scenario please Message-ID: <563@mcgill-vision.UUCP> Date: Sun, 23-Nov-86 22:39:46 EST Article-I.D.: mcgill-v.563 Posted: Sun Nov 23 22:39:46 1986 Date-Received: Mon, 24-Nov-86 19:34:33 EST References: <1369@umd5> Distribution: net Organization: McGill University, Montreal Lines: 102 Xref: linus comp.unix.questions:153 comp.unix.wizards:137 In article <1369@umd5>, don@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@harvard.harvard.edu [USA NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode]