home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / execnet.zip / Exec.c next >
Text File  |  1997-10-17  |  498b  |  20 lines

  1. /* Rolf Breuning 25.4.95
  2.    Collect command line arguments and execute them in a command line.
  3.    This allows to simulate OS/2 program objects on network drives which
  4.    support extended attributes.
  5.    */
  6.  
  7. #include <stdlib.h>
  8.  
  9. int main(int argc, char * argv[]) {
  10.   int i;
  11.   char cmd[200], *p = cmd, *arg;
  12.   for (i = 1; i < argc; i++) {
  13.     arg = argv[i];
  14.     if(*arg == '#' && *(arg+1) == '0') arg = argv[0];
  15.     while (*p++ = *arg++);
  16.     *(p-1) = ' ';
  17.     };
  18.   system(cmd);
  19. }
  20.