home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixlib36d / test / c / popentest < prev    next >
Encoding:
Text File  |  1994-03-08  |  249 b   |  22 lines

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int
  5. main ()
  6. {
  7.   FILE *f;
  8.   char b[256];
  9.  
  10.   if (!(f = popen ("min", "r")))
  11.     {
  12.       perror ("popen()");
  13.       exit (1);
  14.     }
  15.  
  16.   while (fgets (b, 256, f))
  17.     fputs (b, stdout);
  18.  
  19.   pclose (f);
  20.   return 0;
  21. }
  22.