🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #31126

Re: MWC and pexec cooking

#31126
From: Allan Pratt
Date: Mon, 07 Mar 1988 18:49
39 lines
1798 bytes
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
Technical Details
Message-ID: <1007@atari.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!portal!atari!apratt
References: <2794@dadla.TEK.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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