Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hplabsz!sartin From: sartin@hplabsz.HPL.HP.COM (Rob Sartin) Newsgroups: comp.sys.hp Subject: Re: Strangeness with csh environment variable names? Message-ID: <5372@hplabsz.HPL.HP.COM> Date: 25 May 90 00:05:48 GMT References: <777@limbo.Intuitive.Com> Reply-To: sartin@hplabs.hp.com (Rob Sartin) Organization: Hewlett-Packard, Software & Systems Laboratory Lines: 35 In article <777@limbo.Intuitive.Com> taylor@limbo.Intuitive.Com (Dave Taylor) writes: >While working on a program, I had reason to create a new environment >variable called "PROG-OPTS". Much to my surprise, however, having a >value of that sort in my csh environment caused all sorts of havoc!! Well, the problem is: 1) The system(3) routine uses /bin/sh to run the string that is passed to system(). 2) The Bourne shell (and Korn shell) limits a "name": A blank is a tab or a space. A name is a sequence of letters, digits, or underscores beginning with a letter or underscore. and an environment variable must be a "name". So, when the system() library routine runs the shell to run your command, the shell is getting an error because one of the environment variables is not a valid "name". Unfortunately, the only workaround is "don't do that". The behaviour is the same on my 7.0 series 300 machine (in case you care, the Korn shell error message is "invalid identifier" rather than the "is not an identifier" given by the Bourne shell). I would suspect that the behaviour won't change since it was inherited from AT&T and is probably in some important standard somewhere. Disclaimer: I don't work on the HP-UX product and don't speak for Hewlett-Packard. Rob Sartin internet: sartin@hplabs.hp.com Software & Systems Lab uucp : hplabs!sartin Hewlett-Packard voice : (415) 857-7592