home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / unixlib / !UnixLib / test / c / systest < prev    next >
Encoding:
Text File  |  1994-03-08  |  339 b   |  26 lines

  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include "sys/syslib.h"
  6.  
  7. int
  8. main ()
  9. {
  10.   int i;
  11.   char b[256];
  12.  
  13.   for (;;)
  14.     {
  15.       if (!fgets (b, 256, stdin))
  16.     break;
  17.       b[strlen (b) - 1] = 0;
  18.       i = system (b);
  19.       if (i < 0)
  20.     perror ("system()");
  21.       else
  22.     printf ("Return Value: %d\n", i);
  23.     }
  24.   return 0;
  25. }
  26.