1: /* nice */
   2: int nicarg  4;
   3: char    *args[100];
   4: char    string[10000];
   5: 
   6: main(argc, argv)
   7: int argc;
   8: char *argv[];
   9: {
  10:     int i;
  11:     register char **argp, *strp, *p;
  12: 
  13:     if(argc > 1 && argv[1][0] == '-') {
  14:         nicarg = atoi(&argv[1][1]);
  15:         argc--;
  16:         argv++;
  17:     }
  18:     if(argc < 2) {
  19:         printf("usage: nice [ -n ] command\n");
  20:         exit(1);
  21:     }
  22:     argc--;
  23:     argv++;
  24:     argp = args;
  25:     strp = string;
  26:     for (i=0; i<9; i++)
  27:         *strp++ = "/usr/bin/"[i];
  28:     for(i=0; i<argc; i++) {
  29:         *argp++ = strp;
  30:         p = *argv++;
  31:         while(*strp++ = *p++);
  32:     }
  33:     *argp = 0;
  34:     nice(nicarg);
  35:     execv(string+9, args);
  36:     execv(string+4, args);
  37:     execv(string, args);
  38:     printf("%s not found\n", string+9);
  39:     exit(1);
  40: }

Defined functions

main defined in line 6; never used

Defined variables

args defined in line 3; used 4 times
nicarg defined in line 2; used 2 times
string defined in line 4; used 5 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 624
Valid CSS Valid XHTML 1.0 Strict