--- ray/src/px/pcomb.c 1991/05/27 09:01:05 1.18 +++ ray/src/px/pcomb.c 1991/05/30 10:14:39 1.20 @@ -25,7 +25,7 @@ static char SCCSid[] = "$SunId$ LBL"; #define BRT (-1) /* special index for brightness */ struct { - char *name; /* file name */ + char *name; /* file or command name */ FILE *fp; /* stream pointer */ COLOR *scan[WINSIZ]; /* input scanline window */ COLOR coef; /* coefficient */ @@ -61,7 +61,9 @@ int xpos, ypos; /* output position */ int wrongformat = 0; +FILE *popen(); + main(argc, argv) int argc; char *argv[]; @@ -124,7 +126,9 @@ char *argv[]; } else { input[nfiles].name = argv[a]; - input[nfiles].fp = fopen(argv[a], "r"); + input[nfiles].fp = argv[a][0]=='!' ? + popen(argv[a]+1, "r") : + fopen(argv[a], "r"); if (input[nfiles].fp == NULL) { perror(argv[a]); quit(1); @@ -194,7 +198,7 @@ usage: eputs("Usage: "); eputs(argv[0]); eputs( -" [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); +" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); quit(1); }