some-usable-scripts/c/testargs.c

19 lines
350 B
C
Raw Normal View History

// This file displays the GDMSESSION environment variable
// Try with others if you want, you know how to now
2011-02-03 13:47:29 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
int main( int argc, char **argv, char ** envp)
{
while(*envp != NULL)
{
if(strstr(*envp, "GDMSESSION") != NULL)
printf("%s\n", *envp);
*envp++;
}
}