ack/util/int/test/args.c
1988-06-24 15:40:41 +00:00

33 lines
513 B
C

/* $Header$ */
/*
Test access to args and environ
*/
extern char **environ;
main(argc, argv, envp)
char **argv, **envp;
{
int i;
printf("# of args: %d\n", argc);
printf("\n");
for (i = 0; argv[i] != 0; i++)
printf("$%d=%s\n", i, argv[i]);
printf("\n");
for (i = 0; envp[i] != 0; i++)
printf("%s\n", envp[i]);
if (envp != environ) {
printf("\n");
printf("different environment from `environ':\n");
for (i = 0; envp[i] != 0; i++)
printf("%s\n", envp[i]);
printf("\n");
}
exit(0);
}