summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/SNIP/do.c
blob: 67bf758239ee355fa14b0a31db6bd13c69ee4415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
**  DO.C - a simple facility for specifying multiple commands
*/

#include <stdio.h>
#include <stdlib.h>

void main(int argc, char *argv[])
{
      if (2 > argc)
      {
            puts("Usage: DO \"DOS command 1\" \"DOS command 2\" ...");
            return;
      }
      while (--argc)
            system(*++argv);
}