--- ray/src/px/pcomb.c 1991/05/27 09:01:05 1.18 +++ ray/src/px/pcomb.c 1991/05/30 09:47:14 1.19 @@ -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);