"Re: Undocumented Stuff"
H.MORRIS
hom at hocda.UUCP
Thu Mar 22 09:04:14 AEST 1984
Speaking of undocumented things, the most startling one I know
of is the third argument to main() which exists on every U**X
I have worked with, and which points to the list of environment
variables. Normally you don't declare it and that is fine,
but I started noticing some utility programs with this argument
(like many version of shell would have to have it).
If it's documented anywhere, I'd be interested in knowing
about it. E.g. to print the list of environment variables:
main(argc, argv, envp)
char *argv[], *envp[];
{
register char **p;
for(p=envp; *p ; ++p)
puts(*p);
}
Does anyone have a UNIX on which this doesn't work?
More information about the Comp.unix.wizards
mailing list