mpw-tools/GetEnv.c
2013-07-14 18:15:56 -04:00

29 lines
446 B
C

/*
*
* GetEnv variable
* read an mpw variable.
* eg: CLibraries=`mpw GetEnv CLibraries`
* (makefile) CLibraries = $(shell mpw GetEnv CLibraries)
* flags to do name = value?
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
char *value;
char *name;
if (argc != 2)
{
return 1;
}
name = argv[1];
value = getenv(name);
// value == null if not defined.
if (value) puts(value);
return 0;
}