summaryrefslogtreecommitdiff
path: root/reference/C/EXAMPLES/printenv.c
blob: fc7f9da4e07b106a065f8e26af3edbc7e0b2cc49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/******************************************************************
 *
 * Purpose: Program to demonstrate the 'environ' variable
 *          by emulating the Unix printenv command.
 * Date:    21-May-96
 * Author:  M J Leslie.
 * Descrip: 'environ' is declared in stdlib.h and points to 
 *          a list of environmental variables.
 *
 ******************************************************************/

#include <stdlib.h>

main()
{
  int    Count;
  char   *Line;

  while(Line = *(environ+Count))
  {
    printf("%s \n", Line);
    Count++;
  }
}