Path: utzoo!mnetor!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: MWC and pexec cooking Message-ID: <1007@atari.UUCP> Date: 7 Mar 88 18:49:11 GMT References: <2794@dadla.TEK.COM> Organization: Atari Corp., Sunnyvale CA Lines: 39 From article <2794@dadla.TEK.COM>, by jrb@dadla.TEK.COM (Jim Binkley): > command = "\\bin\\date.prg"; > args = " 200001322400"; /* note the blank :->... */ > pexec(0,command,args,"PATH=\0"); > > What happens when we say "PATH=\0"? What happens is you are explicitly passing the perfectly legitimate environment consisting of one variable, PATH, which has no value. The \0 is the null byte ending the PATH value, and C puts another null after that to terminate the string -- the double null is the end of the environment. The environment (as defined by UNIX and used by Atari) consists of strings separated by nulls, with a second null after the last one which terminates the whole environment. Conventionally, the "strings" mentioned here are of the form name=value where name (usually all caps) is called an "environment variable" and value is its value (arbitrary text). For instance, MAILER=/usr/ucb/Mail is one environment variable which tells anybody who cares to ask what program to use to send mail. The point of the environment is to communicate things to programs which you don't want to have to say in a config file or on the command line, like your name, your home directory, what shell you're using, etc. Does this answer your question? ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt